public function save(Doctrine_Connection $con = null) { $id = $this->getId(); $q = parent::save(); if (!$id) { Doctrine::getTable("Shoutbox")->setShout(array("postedNewNews", "newspaper_add.png", $this->getTitle()), sfContext::getInstance()->getController()->genUrl("@news?slug=" . $this->getSlug())); } return $q; }
public function beforeSave() { if ($this->isNewRecord) { $this->create_time = $this->update_time = time(); $this->user_id = Yii::app()->user->id; } else { $this->update_time = time(); } return parent::beforeSave(); }
public function delete($con = null) { try { $con = Propel::getConnection(); $con->begin(); Document::getGenericDocument($this)->delete(); parent::delete(); $con->commit(); Document::deleteObjCache($this); return true; } catch (Exception $e) { $con->rollback(); throw $e; } }
public function getPeer() { if (self::$peer === null) { self::$peer = new NewsPeer(); } return self::$peer; }
public function init() { return parent::init(); }