src/snac/server/database/DBUtil.php
/**
     * Populate the meta cache
     *
     * Gets all the SCMs associated with the queried constellation and stores them in a cache for use
     * when populating the various constellation pieces
     *
     * @param string[] $vhInfo Associative array of version information including 'ic_id' and 'version'
     */
Populate the meta cache
Gets all the SCMs associated with the queried constellation and stores them in a cache for use
when populating the various constellation pieces

@param string[] $vhInfo Associative array of version information including 'ic_id' and 'version'
Populate the meta cache Gets all the SCMs associated with the queried constellation and stores them in a cache for use when populating the various constellation pieces @param string [] $vhInfo Associative array of version information including ' ic_id ' and ' version '
private function populateMetaCache($vhInfo)
    {
        $this->dataCache["meta"] = array();
        if ( $recList = $this->sql->selectAllMetaForConstellation($vhInfo['ic_id'], $vhInfo['version']))
        {
            foreach($recList as $rec)
            {
                if (!isset($this->dataCache["meta"][$rec['fk_table']]))
                    $this->dataCache["meta"][$rec['fk_table']] = array();
                if (!isset($this->dataCache["meta"][$rec['fk_table']][$rec['fk_id']]))
                    $this->dataCache["meta"][$rec['fk_table']][$rec['fk_id']] = array();
                $gObj = new \snac\data\SNACControlMetadata();
                $gObj->setSubCitation($rec['sub_citation'] ?? '');
                $gObj->setSourceData($rec['source_data']);
                $gObj->setDescriptiveRule($this->populateTerm($rec['rule_id']));
                $gObj->setNote($rec['note']);
                $gObj->setDBInfo($rec['version'], $rec['id']);
                $this->populateLanguage($vhInfo, $gObj, $rec['id'], 'scm');
                $this->populateSourceByID($vhInfo, $gObj, $rec['citation_id']);
                array_push($this->dataCache["meta"][$rec['fk_table']][$rec['fk_id']], $gObj);
            }
        }
    }
private function populateMetaCache ( $ vhInfo ) { $ this -> dataCache [ " meta " ] = array ( ) ; if ( $ recList = $ this -> sql -> selectAllMetaForConstellation ( $ vhInfo [ 'ic_id' ] , $ vhInfo [ 'version' ] ) ) { foreach ( $ recList as $ rec ) { if ( ! isset ( $ this -> dataCache [ " meta " ] [ $ rec [ 'fk_table' ] ] ) ) $ this -> dataCache [ " meta " ] [ $ rec [ 'fk_table' ] ] = array ( ) ; if ( ! isset ( $ this -> dataCache [ " meta " ] [ $ rec [ 'fk_table' ] ] [ $ rec [ 'fk_id' ] ] ) ) $ this -> dataCache [ " meta " ] [ $ rec [ 'fk_table' ] ] [ $ rec [ 'fk_id' ] ] = array ( ) ; $ gObj = new \ snac \ data \ SNACControlMetadata ( ) ; $ gObj -> setSubCitation ( $ rec [ 'sub_citation' ] ?? '' ) ; $ gObj -> setSourceData ( $ rec [ 'source_data' ] ) ; $ gObj -> setDescriptiveRule ( $ this -> populateTerm ( $ rec [ 'rule_id' ] ) ) ; $ gObj -> setNote ( $ rec [ 'note' ] ) ; $ gObj -> setDBInfo ( $ rec [ 'version' ] , $ rec [ 'id' ] ) ; $ this -> populateLanguage ( $ vhInfo , $ gObj , $ rec [ 'id' ] , 'scm' ) ; $ this -> populateSourceByID ( $ vhInfo , $ gObj , $ rec [ 'citation_id' ] ) ; array_push ( $ this -> dataCache [ " meta " ] [ $ rec [ 'fk_table' ] ] [ $ rec [ 'fk_id' ] ] , $ gObj ) ; } } }
Populate the meta cache
 Gets all the SCMs associated with the queried constellation and stores them in a cache for use
 when populating the various constellation pieces
Populate the meta cache Gets all the SCMs associated with the queried constellation and stores them in a cache for use when populating the various constellation pieces
/*
         * $gRows where g is for generic. As in "a generic object". Make this as idiomatic as possible.
         * I'm pretty sure that first arg is an $fkID.
         */ /*
                 * Prior to creating the Language object, language was strange and not fully functional. Now
                 * language is a related record that links back here via our record id as a foreign key.
                 */ /*
                 * populateSourceByID() will call setCitation() for SNACControlMetadata objects and
                 * addSource() for Constellation object. SCM has only a single source, so it calls
                 * populateSourceByID().
                 */