Beispiel #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;
 }
Beispiel #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();
 }
Beispiel #3
0
 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;
     }
 }
Beispiel #4
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new NewsPeer();
     }
     return self::$peer;
 }
Beispiel #5
0
 public function init()
 {
     return parent::init();
 }