src/snac/server/database/DBUtil.php
/**
     * Save the resource origination name
     *
     * Save all the origination names (if they have insert or update operation) from the given
     * resource.
     *
     * @param \snac\data\Resource $resource The resource object with origination names to save
     */
Save the resource origination name
Save all the origination names (if they have insert or update operation) from the given
resource.

@param \snac\data\Resource $resource The resource object with origination names to save
Save the resource origination name Save all the origination names ( if they have insert or update operation ) from the given resource . @param \ snac \ data \ Resource $resource The resource object with origination names to save
private function saveOriginationNames($resource) {
        foreach ($resource->getOriginationNames() as $ron) {
            $rid = $ron->getID();
            if ($ron->getOperation() == \snac\data\OriginationName::$OPERATION_INSERT ||
                $ron->getOperation() == \snac\data\OriginationName::$OPERATION_UPDATE) {
                $rid = $this->sql->insertOriginationName($resource->getID(),
                                              $resource->getVersion(),
                                              $rid,
                                              $ron->getName());
                $ron->setID($rid);
                $ron->setVersion($resource->getVersion());
            }
        }
    }
private function saveOriginationNames ( $ resource ) { foreach ( $ resource -> getOriginationNames ( ) as $ ron ) { $ rid = $ ron -> getID ( ) ; if ( $ ron -> getOperation ( ) == \ snac \ data \ OriginationName :: $ OPERATION_INSERT || $ ron -> getOperation ( ) == \ snac \ data \ OriginationName :: $ OPERATION_UPDATE ) { $ rid = $ this -> sql -> insertOriginationName ( $ resource -> getID ( ) , $ resource -> getVersion ( ) , $ rid , $ ron -> getName ( ) ) ; $ ron -> setID ( $ rid ) ; $ ron -> setVersion ( $ resource -> getVersion ( ) ) ; } } }
Save the resource origination name
 Save all the origination names (if they have insert or update operation) from the given
 resource.
Save the resource origination name Save all the origination names ( if they have insert or update operation ) from the given resource .
/*
             * Other functions call getID() twice. Unclear if that is a feature or just an oversight.  Here I
             * call getID before the if() statement to get what may (or may not) be a non-null record
             * id. Inside the if I use the $rid variable.
             */