src/snac/server/database/DBUtil.php
/**
     * Middle layer write constellation to db (new)
     *
     * We already have a version and ic_id, but must write a version_history record. We got the new version
     * from selectNewVersion() and the new ic_id from selectNewID().
     *
     * @param int[] $vhInfo A list with keys 'ic_id' and 'version'
     *
     * @param \snac\data\Constellation $cObj A constellation object. Remember that php objects are passed by
     * reference.
     *
     * No return value. $cObj is passed by reference, and is changed in place by the save functions, as
     * necessary to update/populate id and version.
     *
     */
Middle layer write constellation to db (new)
We already have a version and ic_id, but must write a version_history record. We got the new version
from selectNewVersion() and the new ic_id from selectNewID().

@param int[] $vhInfo A list with keys 'ic_id' and 'version'

@param \snac\data\Constellation $cObj A constellation object. Remember that php objects are passed by
reference.

No return value. $cObj is passed by reference, and is changed in place by the save functions, as
necessary to update/populate id and version.
Middle layer write constellation to db ( new ) We already have a version and ic_id but must write a version_history record . We got the new version from selectNewVersion () and the new ic_id from selectNewID () . @param int [] $vhInfo A list with keys ' ic_id ' and ' version ' @param \ snac \ data \ Constellation $cObj A constellation object . Remember that php objects are passed by reference . No return value . $cObj is passed by reference and is changed in place by the save functions as necessary to update / populate id and version .
private function coreWrite($vhInfo, $cObj)
    {
        $cObj->setID($vhInfo['ic_id']);
        $cObj->setVersion($vhInfo['version']);
        $this->saveMeta($vhInfo, $cObj, 'version_history', $vhInfo['ic_id']);
        $this->saveBiogHist($vhInfo, $cObj);
        $this->saveConstellationDate($vhInfo, $cObj);
        $this->saveSource($vhInfo, $cObj); 
        $this->saveConventionDeclaration($vhInfo, $cObj);
        $this->saveActivity($vhInfo, $cObj);
        $this->saveGender($vhInfo, $cObj);
        $this->saveGeneralContext($vhInfo, $cObj);
        $this->saveLegalStatus($vhInfo, $cObj);
        $this->saveLanguage($vhInfo, $cObj, 'version_history', $vhInfo['ic_id']);
        $this->saveMandate($vhInfo, $cObj);
        $this->saveName($vhInfo, $cObj);
        $this->saveNationality($vhInfo, $cObj);
        $this->saveNrd($vhInfo, $cObj);
        $this->saveOccupation($vhInfo, $cObj);
        $this->saveOtherRecordID($vhInfo, $cObj);
        $this->saveEntityID($vhInfo, $cObj);
        $this->savePlace($vhInfo, $cObj, 'version_history', $vhInfo['ic_id']);
        $this->saveStructureOrGenealogy($vhInfo, $cObj);
        $this->saveSubject($vhInfo, $cObj);
        $this->saveRelation($vhInfo, $cObj); 
        $this->saveResourceRelation($vhInfo, $cObj);
    }
private function coreWrite ( $ vhInfo , $ cObj ) { $ cObj -> setID ( $ vhInfo [ 'ic_id' ] ) ; $ cObj -> setVersion ( $ vhInfo [ 'version' ] ) ; $ this -> saveMeta ( $ vhInfo , $ cObj , 'version_history' , $ vhInfo [ 'ic_id' ] ) ; $ this -> saveBiogHist ( $ vhInfo , $ cObj ) ; $ this -> saveConstellationDate ( $ vhInfo , $ cObj ) ; $ this -> saveSource ( $ vhInfo , $ cObj ) ; $ this -> saveConventionDeclaration ( $ vhInfo , $ cObj ) ; $ this -> saveActivity ( $ vhInfo , $ cObj ) ; $ this -> saveGender ( $ vhInfo , $ cObj ) ; $ this -> saveGeneralContext ( $ vhInfo , $ cObj ) ; $ this -> saveLegalStatus ( $ vhInfo , $ cObj ) ; $ this -> saveLanguage ( $ vhInfo , $ cObj , 'version_history' , $ vhInfo [ 'ic_id' ] ) ; $ this -> saveMandate ( $ vhInfo , $ cObj ) ; $ this -> saveName ( $ vhInfo , $ cObj ) ; $ this -> saveNationality ( $ vhInfo , $ cObj ) ; $ this -> saveNrd ( $ vhInfo , $ cObj ) ; $ this -> saveOccupation ( $ vhInfo , $ cObj ) ; $ this -> saveOtherRecordID ( $ vhInfo , $ cObj ) ; $ this -> saveEntityID ( $ vhInfo , $ cObj ) ; $ this -> savePlace ( $ vhInfo , $ cObj , 'version_history' , $ vhInfo [ 'ic_id' ] ) ; $ this -> saveStructureOrGenealogy ( $ vhInfo , $ cObj ) ; $ this -> saveSubject ( $ vhInfo , $ cObj ) ; $ this -> saveRelation ( $ vhInfo , $ cObj ) ; $ this -> saveResourceRelation ( $ vhInfo , $ cObj ) ; }
Middle layer write constellation to db (new)
 We already have a version and ic_id, but must write a version_history record.
Middle layer write constellation to db ( new ) We already have a version and ic_id but must write a version_history record .
/*
         * Always update the constellation ID and version, even when not inserting into table nrd. The
         * constellation ID and version are more properly connected to table version_history, but due to
         * historical baggage we tend to conflate nrd and constellation.
         *
         * May 6 2016: Call the setters early, and then call the getters instead of simply using $vhInfo. It
         * doesn't make a functional difference, but it clarifies our intention.
         */ // Source objects are only per constellation. Other uses of source are by foreign key. // aka cpfRelation, constellationRelation, related_identity