Пример #1
0
 /**
  * (non-PHPdoc)
  * @see Backend_Controller_Crud::updateObject()
  */
 public function updateObject(Db_Object $object)
 {
     $author = $object->get('author_id');
     if (empty($author)) {
         $object->set('author_id', $this->_user->getId());
     }
     if (!$object->saveVersion()) {
         Response::jsonError($this->_lang->CANT_CREATE);
     }
     $stagingUrl = $this->getStagingUrl($object);
     Response::jsonSuccess(array('id' => $object->getId(), 'version' => $object->getVersion(), 'staging_url' => $stagingUrl, 'published_version' => $object->get('published_version'), 'published' => $object->get('published')));
 }