src/snac/server/database/DBUtil.php
/**
     * Save resourceRelation
     *
     * This is resourceRelation aka related_resource which is a related archival material (as opposed to a
     * relation to another constellation).
     *
     * ignored: $this->linkType, @xlink:type always 'simple', vocab source_type, .type
     *
     * | placeholder | php                 | what, CPF                                        | sql                  |
     * |-------------+---------------------+--------------------------------------------------+----------------------|
     * |           1 | $vhInfo['version']  |                                                  | .version             |
     * |           2 | $vhInfo['ic_id']  |                                                  | .ic_id             |
     * |           3 | documentType        | @xlink:role id fk to vocab document_type         | .role                |
     * |           4 | entryType           | relationEntry@localType, AnF, always 'archival'? | .relation_entry_type |
     * |           5 | link                | @xlink:href                                      | .href                |
     * |           6 | role                | @xlink:arcrole vocab document_role               | .arcrole             |
     * |           7 | content             | relationEntry, usually a name                    | .relation_entry      |
     * |           8 | source              | objectXMLWrap                                    | .object_xml_wrap     |
     * |           9 | note                | descriptiveNote                                  | .descriptive_note    |
     *
     * Final arg is a list of all the scalar values that will eventually be passed to execute() in the SQL
     * function. This convention is already in use in a couple of places, but needs to be done for some
     * existing functions.
     *
     * @param integer[] $vhInfo list with keys version, ic_id.
     *
     * @param $cObj \snac\data\Constellation object
     */
Save resourceRelation
This is resourceRelation aka related_resource which is a related archival material (as opposed to a
relation to another constellation).

$this->linkType, @xlink:type always 'simple', vocab source_type, .type



Final arg is a list of all the scalar values that will eventually be passed to execute() in the SQL
function. This convention is already in use in a couple of places, but needs to be done for some
existing functions.

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

@param $cObj \snac\data\Constellation object
Save resourceRelation This is resourceRelation aka related_resource which is a related archival material ( as opposed to a relation to another constellation ) . $this - > linkType @xlink : type always ' simple ' vocab source_type . type Final arg is a list of all the scalar values that will eventually be passed to execute () in the SQL function . This convention is already in use in a couple of places but needs to be done for some existing functions . @param integer [] $vhInfo list with keys version ic_id . @param $cObj \ snac \ data \ Constellation object
private function saveResourceRelation($vhInfo, $cObj)
    {
        foreach ($cObj->getResourceRelations() as $fdata)
        {
            $rid = $fdata->getID();
            if ($this->prepOperation($vhInfo, $fdata))
            {
                $resourceVersion = $fdata->getResource()->getVersion();
                if (!$resourceVersion)
                {
                    $resourceVersion = $this->sql->selectCurrentResourceVersion($fdata->getResource()->getID());
                }
                $rid = $this->sql->insertResourceRelation($vhInfo,
                                                          $fdata->getResource()->getID(),
                                                          $resourceVersion,
                                                          $this->termID($fdata->getRole()), 
                                                          $fdata->getContent(), 
                                                          $fdata->getNote(), 
                                                          $fdata->getID());
                $fdata->setID($rid);
                $fdata->setVersion($vhInfo['version']);
            }
            $this->saveMeta($vhInfo, $fdata, 'related_resource', $rid);
        }
    }
private function saveResourceRelation ( $ vhInfo , $ cObj ) { foreach ( $ cObj -> getResourceRelations ( ) as $ fdata ) { $ rid = $ fdata -> getID ( ) ; if ( $ this -> prepOperation ( $ vhInfo , $ fdata ) ) { $ resourceVersion = $ fdata -> getResource ( ) -> getVersion ( ) ; if ( ! $ resourceVersion ) { $ resourceVersion = $ this -> sql -> selectCurrentResourceVersion ( $ fdata -> getResource ( ) -> getID ( ) ) ; } $ rid = $ this -> sql -> insertResourceRelation ( $ vhInfo , $ fdata -> getResource ( ) -> getID ( ) , $ resourceVersion , $ this -> termID ( $ fdata -> getRole ( ) ) , $ fdata -> getContent ( ) , $ fdata -> getNote ( ) , $ fdata -> getID ( ) ) ; $ fdata -> setID ( $ rid ) ; $ fdata -> setVersion ( $ vhInfo [ 'version' ] ) ; } $ this -> saveMeta ( $ vhInfo , $ fdata , 'related_resource' , $ rid ) ; } }
Save resourceRelation
 This is resourceRelation aka related_resource which is a related archival material (as opposed to a
 relation to another constellation).
Save resourceRelation This is resourceRelation aka related_resource which is a related archival material ( as opposed to a relation to another constellation ) .
// xlink:arcrole // relationEntry // descriptiveNote