src/snac/server/database/DBUtil.php
/**
     * Populate the date cache
     *
     * Gets all the dates 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 date cache
Gets all the dates 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 date cache Gets all the dates 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 populateDateCache($vhInfo) {
        $this->dataCache["dates"] = array();
        $dateRows = $this->sql->selectAllDatesForConstellation($vhInfo["ic_id"], $vhInfo['version']);
        foreach ($dateRows as $singleDate)
        {
            if (!isset($this->dataCache["dates"][$singleDate['fk_table']]))
                $this->dataCache["dates"][$singleDate['fk_table']] = array();
            if (!isset($this->dataCache["dates"][$singleDate['fk_table']][$singleDate['fk_id']]))
                $this->dataCache["dates"][$singleDate['fk_table']][$singleDate['fk_id']] = array();
            $dateObj = new \snac\data\SNACDate();
            $dateObj->setRange($this->db->pgToBool($singleDate['is_range']));
            $dateObj->setFromDate($singleDate['from_original'],
                                  $singleDate['from_date'],
                                  $this->populateTerm($singleDate['from_type']));
            $dateObj->setFromBC($this->db->pgToBool($singleDate['from_bc']));
            $dateObj->setFromDateRange($singleDate['from_not_before'], $singleDate['from_not_after']);
            $dateObj->setToDate($singleDate['to_original'],
                                $singleDate['to_date'],
                                $this->populateTerm($singleDate['to_type']));
            $dateObj->setToBC($this->db->pgToBool($singleDate['to_bc']));
            $dateObj->setToDateRange($singleDate['to_not_before'], $singleDate['to_not_after']);
            $dateObj->setNote($singleDate['descriptive_note']);
            $dateObj->setDBInfo($singleDate['version'], $singleDate['id']);
            $this->populateMeta($vhInfo, $dateObj, 'date_range');
            array_push($this->dataCache["dates"][$singleDate['fk_table']][$singleDate['fk_id']], $dateObj);
        }
    }
private function populateDateCache ( $ vhInfo ) { $ this -> dataCache [ " dates " ] = array ( ) ; $ dateRows = $ this -> sql -> selectAllDatesForConstellation ( $ vhInfo [ " ic_id " ] , $ vhInfo [ 'version' ] ) ; foreach ( $ dateRows as $ singleDate ) { if ( ! isset ( $ this -> dataCache [ " dates " ] [ $ singleDate [ 'fk_table' ] ] ) ) $ this -> dataCache [ " dates " ] [ $ singleDate [ 'fk_table' ] ] = array ( ) ; if ( ! isset ( $ this -> dataCache [ " dates " ] [ $ singleDate [ 'fk_table' ] ] [ $ singleDate [ 'fk_id' ] ] ) ) $ this -> dataCache [ " dates " ] [ $ singleDate [ 'fk_table' ] ] [ $ singleDate [ 'fk_id' ] ] = array ( ) ; $ dateObj = new \ snac \ data \ SNACDate ( ) ; $ dateObj -> setRange ( $ this -> db -> pgToBool ( $ singleDate [ 'is_range' ] ) ) ; $ dateObj -> setFromDate ( $ singleDate [ 'from_original' ] , $ singleDate [ 'from_date' ] , $ this -> populateTerm ( $ singleDate [ 'from_type' ] ) ) ; $ dateObj -> setFromBC ( $ this -> db -> pgToBool ( $ singleDate [ 'from_bc' ] ) ) ; $ dateObj -> setFromDateRange ( $ singleDate [ 'from_not_before' ] , $ singleDate [ 'from_not_after' ] ) ; $ dateObj -> setToDate ( $ singleDate [ 'to_original' ] , $ singleDate [ 'to_date' ] , $ this -> populateTerm ( $ singleDate [ 'to_type' ] ) ) ; $ dateObj -> setToBC ( $ this -> db -> pgToBool ( $ singleDate [ 'to_bc' ] ) ) ; $ dateObj -> setToDateRange ( $ singleDate [ 'to_not_before' ] , $ singleDate [ 'to_not_after' ] ) ; $ dateObj -> setNote ( $ singleDate [ 'descriptive_note' ] ) ; $ dateObj -> setDBInfo ( $ singleDate [ 'version' ] , $ singleDate [ 'id' ] ) ; $ this -> populateMeta ( $ vhInfo , $ dateObj , 'date_range' ) ; array_push ( $ this -> dataCache [ " dates " ] [ $ singleDate [ 'fk_table' ] ] [ $ singleDate [ 'fk_id' ] ] , $ dateObj ) ; } }
Populate the date cache
 Gets all the dates associated with the queried constellation and stores them in a cache for use
 when populating the various constellation pieces
Populate the date cache Gets all the dates associated with the queried constellation and stores them in a cache for use when populating the various constellation pieces