src/snac/server/database/DBUtil.php
/**
     * Populate Resource
     *
     * The private method that reads the Resource from the database with the given id and version numbers.
     *
     * @param int $id ID of the resource to read
     * @param int $version Version number of the resource to read
     *
     * @return \snac\data\Resource|null The resource found, or null if it doesn't exist
     */
Populate Resource
The private method that reads the Resource from the database with the given id and version numbers.

@param int $id ID of the resource to read
@param int $version Version number of the resource to read

@return \snac\data\Resource|null The resource found, or null if it doesn't exist
Populate Resource The private method that reads the Resource from the database with the given id and version numbers . @param int $id ID of the resource to read @param int $version Version number of the resource to read @return \ snac \ data \ Resource|null The resource found or null if it doesn ' t exist
private function populateResource($id, $version)
    {
        $rRows = $this->sql->selectResource($id, $version);
        if (count($rRows) == 1) {
            $oneRes = $rRows[0];
            $rObj = new \snac\data\Resource();
            $rObj->setDocumentType($this->populateTerm($oneRes['type']));
            $rObj->setLink($oneRes['href']);
            $rObj->setSource($oneRes['object_xml_wrap']);
            $rObj->setTitle($oneRes['title']);
            $rObj->setExtent($oneRes['extent']);
            $rObj->setAbstract($oneRes['abstract']);
            $rObj->setDate($oneRes['date']);
            $rObj->setDisplayEntry($oneRes['display_entry']);
            $rObj->setRepository($this->readPublishedConstellationByID($oneRes['repo_ic_id'], DBUtil::$READ_REPOSITORY_SUMMARY));
            $rObj->setDBInfo($oneRes['version'], $oneRes['id']);
            $this->populateOriginationNames($rObj);
            $this->populateResourceLanguages($rObj);
            return $rObj;
        }
        return null;
    }
private function populateResource ( $ id , $ version ) { $ rRows = $ this -> sql -> selectResource ( $ id , $ version ) ; if ( count ( $ rRows ) == 1 ) { $ oneRes = $ rRows [ 0 ] ; $ rObj = new \ snac \ data \ Resource ( ) ; $ rObj -> setDocumentType ( $ this -> populateTerm ( $ oneRes [ 'type' ] ) ) ; $ rObj -> setLink ( $ oneRes [ 'href' ] ) ; $ rObj -> setSource ( $ oneRes [ 'object_xml_wrap' ] ) ; $ rObj -> setTitle ( $ oneRes [ 'title' ] ) ; $ rObj -> setExtent ( $ oneRes [ 'extent' ] ) ; $ rObj -> setAbstract ( $ oneRes [ 'abstract' ] ) ; $ rObj -> setDate ( $ oneRes [ 'date' ] ) ; $ rObj -> setDisplayEntry ( $ oneRes [ 'display_entry' ] ) ; $ rObj -> setRepository ( $ this -> readPublishedConstellationByID ( $ oneRes [ 'repo_ic_id' ] , DBUtil :: $ READ_REPOSITORY_SUMMARY ) ) ; $ rObj -> setDBInfo ( $ oneRes [ 'version' ] , $ oneRes [ 'id' ] ) ; $ this -> populateOriginationNames ( $ rObj ) ; $ this -> populateResourceLanguages ( $ rObj ) ; return $ rObj ; } return null ; }
Populate Resource
 The private method that reads the Resource from the database with the given id and version numbers.
Populate Resource The private method that reads the Resource from the database with the given id and version numbers .
//$rObj->setEntryType($oneRes['entry_type']); /* setLinkType() Not used. Always "simple" See ResourceRelation.php */