src/snac/server/database/SQL.php
/**
     * Select biogHist
     *
     * This table has biogHist records (possibly multiple per constellation), and serves as a record for the
     * biogHist to relate to language via foreign key biog_hist.id. Note that language (like date) relies on
     * the fk from the original table to reside in the language table. Calling code will use a second function
     * to retrieve the langauge of each biogHist, that is: the language related to the biogHist.
     *
     * Note: Even though there is only one biogHist in a given language, eventually there may be multiple
     * translations, each in a different language. We just return all biogHist records that we find and let
     * the calling code figure it out. As of Jan 28 2016, Constellation.php defines private var $biogHists as
     * \snac\data\BiogHist[]. The Constellation is already supporting a list of biogHist.
     *
     * @param string[] $vhInfo associative list with keys: version, ic_id
     *
     * @return string[] A list of associative list with keys: version, ic_id, id, text.
     *
     */
Select biogHist
This table has biogHist records (possibly multiple per constellation), and serves as a record for the
biogHist to relate to language via foreign key biog_hist.id. Note that language (like date) relies on
the fk from the original table to reside in the language table. Calling code will use a second function
to retrieve the langauge of each biogHist, that is: the language related to the biogHist.

Even though there is only one biogHist in a given language, eventually there may be multiple
translations, each in a different language. We just return all biogHist records that we find and let
the calling code figure it out. As of Jan 28 2016, Constellation.php defines private var $biogHists as
\snac\data\BiogHist[]. The Constellation is already supporting a list of biogHist.

@param string[] $vhInfo associative list with keys: version, ic_id

@return string[] A list of associative list with keys: version, ic_id, id, text.
Select biogHist This table has biogHist records ( possibly multiple per constellation ) and serves as a record for the biogHist to relate to language via foreign key biog_hist . id . Note that language ( like date ) relies on the fk from the original table to reside in the language table . Calling code will use a second function to retrieve the langauge of each biogHist that is : the language related to the biogHist . Even though there is only one biogHist in a given language eventually there may be multiple translations each in a different language . We just return all biogHist records that we find and let the calling code figure it out . As of Jan 28 2016 Constellation . php defines private var $biogHists as \ snac \ data \ BiogHist [] . The Constellation is already supporting a list of biogHist . @param string [] $vhInfo associative list with keys : version ic_id @return string [] A list of associative list with keys : version ic_id id text .
public function selectBiogHist($vhInfo)
    {
        $qq = 'sbh';
        $this->sdb->prepare($qq,
                            'select
                            aa.version, aa.ic_id, aa.id, aa.text
                            from biog_hist as aa,
                            (select id, max(version) as version from biog_hist where version<=$1 and ic_id=$2 group by id) as bb
                            where not aa.is_deleted and
                            aa.id=bb.id
                            and aa.version=bb.version');
        $result = $this->sdb->execute($qq,
                                      array($vhInfo['version'],
                                            $vhInfo['ic_id']));
        $rowList = array();
        while($row = $this->sdb->fetchrow($result))
        {
            array_push($rowList, $row);
        }
        $this->sdb->deallocate($qq);
        return $rowList;
    }
public function selectBiogHist ( $ vhInfo ) { $ qq = 'sbh' ; $ this -> sdb -> prepare ( $ qq , 'select
                            aa.version, aa.ic_id, aa.id, aa.text
                            from biog_hist as aa,
                            (select id, max(version) as version from biog_hist where version<=$1 and ic_id=$2 group by id) as bb
                            where not aa.is_deleted and
                            aa.id=bb.id
                            and aa.version=bb.version' ) ; $ result = $ this -> sdb -> execute ( $ qq , array ( $ vhInfo [ 'version' ] , $ vhInfo [ 'ic_id' ] ) ) ; $ rowList = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { array_push ( $ rowList , $ row ) ; } $ this -> sdb -> deallocate ( $ qq ) ; return $ rowList ; }
Select biogHist
 This table has biogHist records (possibly multiple per constellation), and serves as a record for the
 biogHist to relate to language via foreign key biog_hist.id.
Select biogHist This table has biogHist records ( possibly multiple per constellation ) and serves as a record for the biogHist to relate to language via foreign key biog_hist . id .
/*
         * Always use key names explicitly when going from associative context to flat indexed list context.
         */