/** * @return boolean */ public function insert() { $this->databaseControls[] = new Volcano_Component_Control_Database_Static($this->actionController, 'created', new Zend_Db_Expr('NOW()')); $this->controls['state']->setValue(AM_Model_Db_State::STATE_WORK_IN_PROGRESS); if (!parent::insert()) { return false; } $aBind = array(); $aBind['title'] = 'Root page'; $aBind['template'] = AM_Model_Db_Template::TPL_COVER_PAGE; $aBind['revision'] = $this->getPrimaryKeyValue(); $aBind['user'] = $this->user['id']; $aBind['created'] = new Zend_Db_Expr('NOW()'); $aBind['updated'] = new Zend_Db_Expr('NOW()'); $aBind['root_page'] = true; $this->db->insert('page', $aBind); // Update issue $this->db->update('issue', array('updated' => new Zend_Db_Expr('NOW()')), $this->db->quoteInto('id = ?', $this->controls['issue']->getValue())); return true; }
/** * @return boolean */ public function insert() { $this->databaseControls[] = new Volcano_Component_Control_Database_Static($this->actionController, 'created', new Zend_Db_Expr('NOW()')); return parent::insert(); }