Exemplo n.º 1
0
 function insert()
 {
     //Update publication date if it hasn't been set already.
     if (!isset($this->pubDate)) {
         $this->pubDate = time();
     }
     $ret = parent::insert();
     return $ret;
 }
Exemplo n.º 2
0
 function insert()
 {
     $ret = parent::insert();
     //Load the person this is for, and update solr
     if ($this->personId) {
         require_once ROOT_DIR . '/sys/Genealogy/Person.php';
         $person = Person::staticGet('personId', $this->personId);
         $person->saveToSolr();
     }
     return $ret;
 }
Exemplo n.º 3
0
 function insertDetailed($insertInSolr = true)
 {
     $result = parent::insert($insertInSolr);
     if (!$insertInSolr) {
         return $result;
     } else {
         if ($result !== 0) {
             if (!$this->saveToSolr()) {
                 //Could not save to solr
                 return false;
             }
         } else {
             return false;
         }
         return true;
     }
 }
Exemplo n.º 4
0
 function insert()
 {
     if (!isset($this->source) || $this->source == '') {
         $this->source = 'VuFind';
     }
     parent::insert();
 }
Exemplo n.º 5
0
 function insert()
 {
     $result = parent::insert();
     return $result;
 }
Exemplo n.º 6
0
 /**
  * Override the update functionality to save the associated lists
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     $ret = parent::insert();
     if ($ret === FALSE) {
         return $ret;
     } else {
         $this->saveLists();
     }
     return true;
 }
Exemplo n.º 7
0
 /**
  * Override the update functionality to save the related objects
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     $ret = parent::insert();
     if ($ret !== FALSE) {
         $this->saveSubBrowseCategories();
     }
     return $ret;
 }
Exemplo n.º 8
0
 function insert()
 {
     parent::insert();
     global $memCache;
     $memCache->delete('loan_rule_determiners');
 }
Exemplo n.º 9
0
 function insert()
 {
     $this->calcIpRange();
     return parent::insert();
 }
Exemplo n.º 10
0
 function insert()
 {
     $this->created = time();
     $this->dateUpdated = time();
     parent::insert();
 }
Exemplo n.º 11
0
 function insert()
 {
     $result = $this->trigger('insert');
     switch (true) {
         case $result === 'bypass':
             return true;
             break;
         case $result === 'fail':
             return false;
             break;
         default:
             if (parent::insert()) {
                 DB_DataObject_Pluggable::storeToRegistry($this);
                 $this->trigger('postinsert');
                 return true;
             }
             return false;
     }
 }
Exemplo n.º 12
0
 public function insert()
 {
     // avoid those annoying PEAR::DB strict standards warnings it causes
     $old = error_reporting();
     error_reporting(error_reporting() & ~E_STRICT);
     $res = parent::insert();
     // reset
     error_reporting($old);
     return $res;
 }
Exemplo n.º 13
0
 /**
  * Override the update functionality to save the related objects
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     $ret = parent::insert();
     if ($ret === FALSE) {
         return $ret;
     } else {
         $this->saveHolidays();
         $this->saveNearbyBookStores();
         $this->saveFacets();
         $this->saveSearchSources();
         return $ret;
     }
 }
Exemplo n.º 14
0
 function insert()
 {
     //set default values as needed
     if (!isset($this->homeLocationId)) {
         $this->homeLocationId = 0;
     }
     if (!isset($this->myLocation1Id)) {
         $this->myLocation1Id = 0;
     }
     if (!isset($this->myLocation2Id)) {
         $this->myLocation2Id = 0;
     }
     if (!isset($this->bypassAutoLogout)) {
         $this->bypassAutoLogout = 0;
     }
     parent::insert();
     $this->saveRoles();
 }
Exemplo n.º 15
0
 /**
  * Override the update functionality to save the related objects
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     if (isset($this->showInMainDetails) && is_array($this->showInMainDetails)) {
         // convert array to string before storing in database
         $this->showInMainDetails = serialize($this->showInMainDetails);
     }
     $ret = parent::insert();
     if ($ret !== FALSE) {
         $this->saveHolidays();
         $this->saveNearbyBookStores();
         $this->saveFacets();
         $this->saveSearchSources();
         $this->saveLibraryLinks();
         $this->saveLibraryTopLinks();
         $this->saveBrowseCategories();
         $this->saveMoreDetailsOptions();
     }
     return $ret;
 }
 /**
  * Could automatically handle updating "updated" datetime field
  * before calling parent insert()
  *
  * @see DB_DataObject::insert()
  * @param object $dataObject
  * @return mixed
  * @access public
  */
 function insert()
 {
     $this->_refreshUpdated();
     $result = parent::insert();
     $this->audit(1);
     return $result;
 }
Exemplo n.º 17
0
 /**
  * Override the update functionality to save the hours
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     $ret = parent::insert();
     if ($ret !== FALSE) {
         $this->saveHours();
         $this->saveFacets();
     }
     return $ret;
 }
Exemplo n.º 18
0
 function insert()
 {
     if ($this->reviewStatus == 0) {
         $this->reviewStatus = 'Not Reviewed';
     }
     //If the file should be protected with the ACS server, submit the file
     //to the ACS server for protection.
     require_once ROOT_DIR . '/sys/AdobeContentServer.php';
     global $configArray;
     global $user;
     $fileUploaded = false;
     $this->date_added = time();
     $this->addedBy = $user->id;
     $this->date_updated = time();
     //Save the item to the database
     $ret = parent::insert();
     if ($ret) {
         //Package the file as needed
         if ($this->getAccessType() == 'acs' && ($this->item_type == 'epub' || $this->item_type == 'pdf')) {
             $uploadResults = AdobeContentServer::packageFile($configArray['EContent']['library'] . '/' . $this->filename, $this->recordId, $this->id, false, $this->getAvailableCopies());
             if ($uploadResults['success']) {
                 $this->acsId = $uploadResults['acsId'];
                 parent::update();
             } else {
                 return 0;
             }
         }
     }
     //Make sure to also update the record this is attached to so the full text can be generated
     //Do not update parent for now, it will be indexed the next time the index runs.
     /*if ($this->item_type == 'epub' || $this->item_type == 'pdf'){
     			$record = new EContentRecord();
     			$record->id = $this->recordId;
     			$record->find(true);
     			$record->update();
     		}*/
     return $ret;
 }
Exemplo n.º 19
0
 /**
  * Insert a record
  * 
  * @return mixed
  */
 public function insert()
 {
     $this->created = date('Y-m-d H:i:s');
     return parent::insert();
 }
Exemplo n.º 20
0
 function insert()
 {
     //Update Solr only on insert since if we are inserting it needs to be in the index to view it again.
     $ret = parent::insert();
     if ($ret) {
         $this->clearCachedCover();
     }
     return $ret;
 }
Exemplo n.º 21
0
 /**
  * Override the update functionality to save the hours
  *
  * @see DB/DB_DataObject::insert()
  */
 public function insert()
 {
     $ret = parent::insert();
     if ($ret !== FALSE) {
         $this->saveHours();
         $this->saveFacets();
         $this->saveBrowseCategories();
         $this->saveMoreDetailsOptions();
     }
     return $ret;
 }