src/snac/data/Resource.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"] != "Resource")
            return false;
        parent::fromArray($data);
        unset($this->originationNames);
        $this->originationNames = array();
        if (isset($data['originationNames'])) {
            foreach ($data['originationNames'] as $entry) {
                if ($entry != null) {
                    array_push($this->originationNames, new \snac\data\OriginationName($entry));
                }
            }
        }
        unset($this->languages);
        $this->languages = array();
        if (isset($data["languages"]))
            foreach ($data["languages"] as $i => $entry)
                if ($entry != null)
                    $this->languages[$i] = new Language($entry);
        if (isset($data["documentType"]) && $data["documentType"] != null)
            $this->documentType = new \snac\data\Term($data["documentType"]);
        else
            $this->documentType = null;
        if (isset($data["linkType"]) && $data["linkType"] != null)
            $this->linkType = new \snac\data\Term($data["linkType"]);
        else
            $this->linkType = null;
        if (isset($data["link"]))
            $this->link = $data["link"];
        else
            $this->link = null;
        if (isset($data["content"]))
            $this->content = $data["content"];
        else
            $this->content = null;
        if (isset($data["source"]))
            $this->source = $data["source"];
        else
            $this->source = null;
        if (isset($data["title"]))
            $this->title = $data["title"];
        else
            $this->title = null;
        if (isset($data["abstract"]))
            $this->abstract = $data["abstract"];
        else
            $this->abstract = null;
        if (isset($data["extent"]))
            $this->extent = $data["extent"];
        else
            $this->extent = null;
        if (isset($data["date"]))
            $this->date = $data["date"];
        else
            $this->date = null;
        if (isset($data["displayEntry"]))
            $this->displayEntry = $data["displayEntry"];
        else
            $this->displayEntry = null;
        if (isset($data["repository"]) && $data["repository"] != null)
            $this->repository = new \snac\data\Constellation($data["repository"]);
        else
            $this->repository = null;
        return true;
    }
public function fromArray ( $ data ) { if ( ! isset ( $ data [ " dataType " ] ) || $ data [ " dataType " ] != " Resource " ) return false ; parent :: fromArray ( $ data ) ; unset ( $ this -> originationNames ) ; $ this -> originationNames = array ( ) ; if ( isset ( $ data [ 'originationNames' ] ) ) { foreach ( $ data [ 'originationNames' ] as $ entry ) { if ( $ entry != null ) { array_push ( $ this -> originationNames , new \ snac \ data \ OriginationName ( $ entry ) ) ; } } } unset ( $ this -> languages ) ; $ this -> languages = array ( ) ; if ( isset ( $ data [ " languages " ] ) ) foreach ( $ data [ " languages " ] as $ i => $ entry ) if ( $ entry != null ) $ this -> languages [ $ i ] = new Language ( $ entry ) ; if ( isset ( $ data [ " documentType " ] ) && $ data [ " documentType " ] != null ) $ this -> documentType = new \ snac \ data \ Term ( $ data [ " documentType " ] ) ; else $ this -> documentType = null ; if ( isset ( $ data [ " linkType " ] ) && $ data [ " linkType " ] != null ) $ this -> linkType = new \ snac \ data \ Term ( $ data [ " linkType " ] ) ; else $ this -> linkType = null ; if ( isset ( $ data [ " link " ] ) ) $ this -> link = $ data [ " link " ] ; else $ this -> link = null ; if ( isset ( $ data [ " content " ] ) ) $ this -> content = $ data [ " content " ] ; else $ this -> content = null ; if ( isset ( $ data [ " source " ] ) ) $ this -> source = $ data [ " source " ] ; else $ this -> source = null ; if ( isset ( $ data [ " title " ] ) ) $ this -> title = $ data [ " title " ] ; else $ this -> title = null ; if ( isset ( $ data [ " abstract " ] ) ) $ this -> abstract = $ data [ " abstract " ] ; else $ this -> abstract = null ; if ( isset ( $ data [ " extent " ] ) ) $ this -> extent = $ data [ " extent " ] ; else $ this -> extent = null ; if ( isset ( $ data [ " date " ] ) ) $ this -> date = $ data [ " date " ] ; else $ this -> date = null ; if ( isset ( $ data [ " displayEntry " ] ) ) $ this -> displayEntry = $ data [ " displayEntry " ] ; else $ this -> displayEntry = null ; if ( isset ( $ data [ " repository " ] ) && $ data [ " repository " ] != null ) $ this -> repository = new \ snac \ data \ Constellation ( $ data [ " repository " ] ) ; else $ this -> repository = null ; 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