Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
Arquivo: News.php Projeto: kotow/work
 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;
     }
 }
Exemplo n.º 4
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new NewsPeer();
     }
     return self::$peer;
 }
Exemplo n.º 5
0
 public function init()
 {
     return parent::init();
 }