/** * Set SHA1 hash column value to table row. * * @return mixed Database id. */ protected function _preStore() { $this->_primaryTableRow->sha1_id = $this->getSha1Id(); return parent::_preStore(); }
/** * Set internal fields ServerDatePublished and ServerDateModified. * * @return mixed Anything else then null will cancel the storage process. */ protected function _preStore() { $result = parent::_preStore(); $date = new Opus_Date(); $date->setNow(); if (true === $this->isNewRecord()) { if (is_null($this->getServerDateCreated())) { $this->setServerDateCreated($date); } } $this->setServerDateModified($date); if (true === $this->isNewRecord() || true === $this->isModified()) { // Initially set ServerDatePublished if ServerState == 'published' if ($this->getServerState() === 'published') { if (is_null($this->getServerDatePublished())) { $this->setServerDatePublished($date); } } } return $result; }