src/snac/server/database/DBUtil.php
/**
     * Write constellation sources to the database
     *
     * Foreach over a list of all Source objects in a constellation and the sources to the db. Source objects
     * are written to table source, and their related language (if one exists) is written to table Language
     * with a reverse foreign key as usual. Source and language are related on source.id=language.fk_id.
     *
     * Constellation sources can each have an SCM.
     *
     * Any part of a constellation that needs source will link to the source by source->getID().
     *
     * 'type' is always simple, and Daniel says we can ignore it. It was used in EAC-CPF just to quiet
     * validation.
     *
     * @param integer[] $vhInfo list with keys version, ic_id.
     *
     * @param \snac\data\Constellation $cObj The constellation object
     */
Write constellation sources to the database
Foreach over a list of all Source objects in a constellation and the sources to the db. Source objects
are written to table source, and their related language (if one exists) is written to table Language
with a reverse foreign key as usual.

Constellation sources can each have an SCM.

Any part of a constellation that needs source will link to the source by source->getID().

'type' is always simple, and Daniel says we can ignore it. It was used in EAC-CPF just to quiet
validation.

@param integer[] $vhInfo list with keys version, ic_id.

@param \snac\data\Constellation $cObj The constellation object
Write constellation sources to the database Foreach over a list of all Source objects in a constellation and the sources to the db . Source objects are written to table source and their related language ( if one exists ) is written to table Language with a reverse foreign key as usual . Constellation sources can each have an SCM . Any part of a constellation that needs source will link to the source by source - > getID () . ' type ' is always simple and Daniel says we can ignore it . It was used in EAC - CPF just to quiet validation . @param integer [] $vhInfo list with keys version ic_id . @param \ snac \ data \ Constellation $cObj The constellation object
private function saveSource($vhInfo, $cObj)
    {
        foreach ($cObj->getSources() as $gObj)
        {
            $genericRecordID = $gObj->getID();
            if ($this->prepOperation($vhInfo, $gObj))
            {
                $genericRecordID = $this->sql->insertSource($vhInfo,
                                                            $gObj->getID(),
                                                            $gObj->getDisplayName(),
                                                            $gObj->getText(),
                                                            $gObj->getCitation(),
                                                            $gObj->getNote(),
                                                            $gObj->getURI());
                $gObj->setID($genericRecordID);
                $gObj->setVersion($vhInfo['version']);
            }
            $this->saveMeta($vhInfo, $gObj, 'source', $genericRecordID);
            $this->saveLanguage($vhInfo, $gObj, 'source', $genericRecordID);
        }
    }
private function saveSource ( $ vhInfo , $ cObj ) { foreach ( $ cObj -> getSources ( ) as $ gObj ) { $ genericRecordID = $ gObj -> getID ( ) ; if ( $ this -> prepOperation ( $ vhInfo , $ gObj ) ) { $ genericRecordID = $ this -> sql -> insertSource ( $ vhInfo , $ gObj -> getID ( ) , $ gObj -> getDisplayName ( ) , $ gObj -> getText ( ) , $ gObj -> getCitation ( ) , $ gObj -> getNote ( ) , $ gObj -> getURI ( ) ) ; $ gObj -> setID ( $ genericRecordID ) ; $ gObj -> setVersion ( $ vhInfo [ 'version' ] ) ; } $ this -> saveMeta ( $ vhInfo , $ gObj , 'source' , $ genericRecordID ) ; $ this -> saveLanguage ( $ vhInfo , $ gObj , 'source' , $ genericRecordID ) ; } }
Write constellation sources to the database
 Foreach over a list of all Source objects in a constellation and the sources to the db.
Write constellation sources to the database Foreach over a list of all Source objects in a constellation and the sources to the db .
// G for generic in $gObj