src/snac/server/database/DBUtil.php
/**
     * Save Occupation
     *
     * Insert an occupation. If this is a new occupation, or a new constellation we will get a new
     * occupation id which we save in $occID and use for the related dates.
     *
     * fdata is foreach data. Just a notation that the generic variable is for local use in this loop.
     *
     * @param integer[] $vhInfo list with keys version, ic_id.
     *
     * @param $cObj \snac\data\Constellation object
     */
Save Occupation
Insert an occupation. If this is a new occupation, or a new constellation we will get a new
occupation id which we save in $occID and use for the related dates.

fdata is foreach data. Just a notation that the generic variable is for local use in this loop.

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

@param $cObj \snac\data\Constellation object
Save Occupation Insert an occupation . If this is a new occupation or a new constellation we will get a new occupation id which we save in $occID and use for the related dates . fdata is foreach data . Just a notation that the generic variable is for local use in this loop . @param integer [] $vhInfo list with keys version ic_id . @param $cObj \ snac \ data \ Constellation object
private function saveOccupation($vhInfo, $cObj)
    {
        foreach ($cObj->getOccupations() as $fdata)
        {
            $occID = $fdata->getID();
            if ($this->prepOperation($vhInfo, $fdata))
            {
                $occID = $this->sql->insertOccupation($vhInfo,
                                                      $fdata->getID(),
                                                      $this->termID($fdata->getTerm()),
                                                      $fdata->getVocabularySource(),
                                                      $fdata->getNote());
                $fdata->setID($occID);
                $fdata->setVersion($vhInfo['version']);
            }
            $this->saveMeta($vhInfo, $fdata, 'occupation', $occID);
            foreach ($fdata->getDateList() as $date)
            {
                $this->saveDate($vhInfo, $date, 'occupation', $occID);
            }
        }
    }
private function saveOccupation ( $ vhInfo , $ cObj ) { foreach ( $ cObj -> getOccupations ( ) as $ fdata ) { $ occID = $ fdata -> getID ( ) ; if ( $ this -> prepOperation ( $ vhInfo , $ fdata ) ) { $ occID = $ this -> sql -> insertOccupation ( $ vhInfo , $ fdata -> getID ( ) , $ this -> termID ( $ fdata -> getTerm ( ) ) , $ fdata -> getVocabularySource ( ) , $ fdata -> getNote ( ) ) ; $ fdata -> setID ( $ occID ) ; $ fdata -> setVersion ( $ vhInfo [ 'version' ] ) ; } $ this -> saveMeta ( $ vhInfo , $ fdata , 'occupation' , $ occID ) ; foreach ( $ fdata -> getDateList ( ) as $ date ) { $ this -> saveDate ( $ vhInfo , $ date , 'occupation' , $ occID ) ; } } }
Save Occupation
 Insert an occupation.
Save Occupation Insert an occupation .