src/snac/data/Place.php
/**
     * Replaces this object's data with the given associative array
     *
     * @param string[][] $data This objects data in array form
     * @return boolean true on success, false on failure
     */
Replaces this object's data with the given associative array
@param string[][] $data This objects data in array form
@return boolean true on success, false on failure
Replaces this object ' s data with the given associative array @param string [] [] $data This objects data in array form @return boolean true on success false on failure
public function fromArray($data) {
        if (!isset($data["dataType"]) || $data["dataType"] != "Place")
            return false;
        parent::fromArray($data);
        if (isset($data["original"]))
            $this->original = $data["original"];
        else
            $this->original = null;
        if (isset($data["score"]))
            $this->score = $data["score"];
        else
            $this->score = 0;
        if (isset($data["confirmed"]))
            $this->confirmed = $data["confirmed"];
        else
            $this->confirmed = false;
        if (isset($data["type"]) && $data["type"] != null)
            $this->type = new \snac\data\Term($data["type"]);
        else
            $this->type = null;
        if (isset($data["role"]) && $data["role"] != null)
            $this->role = new \snac\data\Term($data["role"]);
        else
            $this->role = null;
        if (isset($data["geoplace"]) && $data["geoplace"] != null)
            $this->geoTerm = new \snac\data\GeoTerm($data["geoplace"]);
        else
            $this->geoTerm = null;
        if (isset($data["note"]))
            $this->note = $data["note"];
        else
            $this->note = null;
        unset($this->address);
        $this->address = array();
        if (isset($data["address"]))
            foreach ($data["address"] as $i => $entry)
                if ($entry != null)
                    $this->address[$i] = new \snac\data\AddressLine($entry);
        return true;
    }
public function fromArray ( $ data ) { if ( ! isset ( $ data [ " dataType " ] ) || $ data [ " dataType " ] != " Place " ) return false ; parent :: fromArray ( $ data ) ; if ( isset ( $ data [ " original " ] ) ) $ this -> original = $ data [ " original " ] ; else $ this -> original = null ; if ( isset ( $ data [ " score " ] ) ) $ this -> score = $ data [ " score " ] ; else $ this -> score = 0 ; if ( isset ( $ data [ " confirmed " ] ) ) $ this -> confirmed = $ data [ " confirmed " ] ; else $ this -> confirmed = false ; if ( isset ( $ data [ " type " ] ) && $ data [ " type " ] != null ) $ this -> type = new \ snac \ data \ Term ( $ data [ " type " ] ) ; else $ this -> type = null ; if ( isset ( $ data [ " role " ] ) && $ data [ " role " ] != null ) $ this -> role = new \ snac \ data \ Term ( $ data [ " role " ] ) ; else $ this -> role = null ; if ( isset ( $ data [ " geoplace " ] ) && $ data [ " geoplace " ] != null ) $ this -> geoTerm = new \ snac \ data \ GeoTerm ( $ data [ " geoplace " ] ) ; else $ this -> geoTerm = null ; if ( isset ( $ data [ " note " ] ) ) $ this -> note = $ data [ " note " ] ; else $ this -> note = null ; unset ( $ this -> address ) ; $ this -> address = array ( ) ; if ( isset ( $ data [ " address " ] ) ) foreach ( $ data [ " address " ] as $ i => $ entry ) if ( $ entry != null ) $ this -> address [ $ i ] = new \ snac \ data \ AddressLine ( $ entry ) ; return true ; }
Replaces this object's data with the given associative array
 @param string[][] $data This objects data in array form
 @return boolean true on success, false on failure
Replaces this object ' s data with the given associative array @param string [] [] $data This objects data in array form @return boolean true on success false on failure