Пример #1
0
 /**
  * Save changes to version.
  * @return int the version ID
  */
 function execute()
 {
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $version = $this->version;
     if (!isset($version)) {
         $version = new RTVersion();
     }
     $version->setTitle($this->getData('title'));
     $version->setKey($this->getData('key'));
     $version->setLocale($this->getData('locale'));
     $version->setDescription($this->getData('description'));
     if (isset($this->version)) {
         $rtDao->updateVersion($this->journalId, $version);
     } else {
         $rtDao->insertVersion($this->journalId, $version);
         $this->versionId = $version->getVersionId();
     }
     return $this->versionId;
 }
Пример #2
0
 /**
  * Return RTVersion object from database row.
  * @param $row array
  * @return RTVersion
  */
 function &_returnVersionFromRow(&$row)
 {
     $version = new RTVersion();
     $version->setVersionId($row['version_id']);
     $version->setKey($row['version_key']);
     $version->setLocale($row['locale']);
     $version->setTitle($row['title']);
     $version->setDescription($row['description']);
     if (!HookRegistry::call('RTDAO::_returnVersionFromRow', array(&$version, &$row))) {
         $contextsIterator =& $this->getContexts($row['version_id']);
         $version->setContexts($contextsIterator->toArray());
     }
     return $version;
 }