src/snac/server/database/DBUtil.php
/**
     * Save SNACControlMetadata to database
     *
     * Might have been called saveSCM().
     *
     * Save the metadata to table scm in the database. Saved record is related to table $fkTable, and record id $fkID.
     *
     * Citation is a Source object. Source objects are like dates: each one is specific to the
     * related record. Source is not a controlled vocabulary. Therefore, like date, Source has
     * an fk back to the original table.
     *
     * Note: this depends on an existing Source, DescriptiveRule, and Language, each in its
     * appropriate table in the database. Or if not existing they can be null.
     *
     * @param integer[] $vhInfo Array with keys 'version', 'ic_id' for this constellation.
     *
     * @param \snac\data\AbstractData $gObj The data object with SCMs
     *
     * @param string $fkTable Name of the table to which this meta data relates
     *
     * @param integer $fkID Record id aka table.id of the record to which this meta data relates.
     *
     */
Save SNACControlMetadata to database
Might have been called saveSCM().

Save the metadata to table scm in the database. Saved record is related to table $fkTable, and record id $fkID.

Citation is a Source object. Source objects are like dates: each one is specific to the
related record. Source is not a controlled vocabulary. Therefore, like date, Source has
an fk back to the original table.

this depends on an existing Source, DescriptiveRule, and Language, each in its
appropriate table in the database. Or if not existing they can be null.

@param integer[] $vhInfo Array with keys 'version', 'ic_id' for this constellation.

@param \snac\data\AbstractData $gObj The data object with SCMs

@param string $fkTable Name of the table to which this meta data relates

@param integer $fkID Record id aka table.id of the record to which this meta data relates.
Save SNACControlMetadata to database Might have been called saveSCM () . Save the metadata to table scm in the database . Saved record is related to table $fkTable and record id $fkID . Citation is a Source object . Source objects are like dates : each one is specific to the related record . Source is not a controlled vocabulary . Therefore like date Source has an fk back to the original table . this depends on an existing Source DescriptiveRule and Language each in its appropriate table in the database . Or if not existing they can be null . @param integer [] $vhInfo Array with keys ' version ' ' ic_id ' for this constellation . @param \ snac \ data \ AbstractData $gObj The data object with SCMs @param string $fkTable Name of the table to which this meta data relates @param integer $fkID Record id aka table . id of the record to which this meta data relates .
private function saveMeta($vhInfo, $gObj, $fkTable, $fkID)
    {
        if (! $metaObjList = $gObj->getSNACControlMetadata())
        {
            return;
        }
        foreach ($metaObjList as $metaObj)
        {
            $metaID = $metaObj->getID();
            if ($this->prepOperation($vhInfo, $metaObj))
            {
                $citationID = null;
                if ($metaObj->getCitation())
                {
                    $citationID = $metaObj->getCitation()->getID();
                }
                $metaID = $this->sql->insertMeta($vhInfo,
                                                 $metaObj->getID(),
                                                 $citationID,
                                                 $metaObj->getSubCitation(),
                                                 $metaObj->getSourceData(),
                                                 $this->termID($metaObj->getDescriptiveRule()),
                                                 $metaObj->getNote(),
                                                 $fkTable,
                                                 $fkID);
                $metaObj->setID($metaID);
                $metaObj->setVersion($vhInfo['version']);
            }
            $this->saveLanguage($vhInfo, $metaObj, 'scm', $metaID);
        }
    }
private function saveMeta ( $ vhInfo , $ gObj , $ fkTable , $ fkID ) { if ( ! $ metaObjList = $ gObj -> getSNACControlMetadata ( ) ) { return ; } foreach ( $ metaObjList as $ metaObj ) { $ metaID = $ metaObj -> getID ( ) ; if ( $ this -> prepOperation ( $ vhInfo , $ metaObj ) ) { $ citationID = null ; if ( $ metaObj -> getCitation ( ) ) { $ citationID = $ metaObj -> getCitation ( ) -> getID ( ) ; } $ metaID = $ this -> sql -> insertMeta ( $ vhInfo , $ metaObj -> getID ( ) , $ citationID , $ metaObj -> getSubCitation ( ) , $ metaObj -> getSourceData ( ) , $ this -> termID ( $ metaObj -> getDescriptiveRule ( ) ) , $ metaObj -> getNote ( ) , $ fkTable , $ fkID ) ; $ metaObj -> setID ( $ metaID ) ; $ metaObj -> setVersion ( $ vhInfo [ 'version' ] ) ; } $ this -> saveLanguage ( $ vhInfo , $ metaObj , 'scm' , $ metaID ) ; } }
Save SNACControlMetadata to database
 Might have been called saveSCM().
Save SNACControlMetadata to database Might have been called saveSCM () .
/*
             * Citation has become a Source and has an ID to a Source table record. No need to save
             * separately.
             */