public function save(Doctrine_Connection $conn = null) { if (!$this->exists()) { $this->setCreatedAt(date('Y-m-d H:i:s')); } $this->setUpdatedAt(date('Y-m-d H:i:s')); parent::save($conn); }
public function save($con = null) { $highlighted = myUtils::highlight($this->getRawBody()); $this->setBody($highlighted['body']); $summarizer = new Summarizer(200); $this->setSummary($summarizer->summarize($this->getBody())); parent::save(); }
public function setTableDefinition() { // Add all the Commentable relations foreach ($this->getCommentables() as $class) { $this->hasMany($class, array('refClass' => $class . 'Comment', 'local' => 'comment_id', 'foreign' => 'id')); $this->hasOne($class . 'Comment', array('local' => 'id', 'foreign' => 'comment_id')); } return parent::setTableDefinition(); }
/** * Delete comment * * @param void * @return null */ function delete() { $deleted = parent::delete(); if ($deleted) { $object = $this->getObject(); if ($object instanceof ProjectDataObject) { $object->onDeleteComment($this); } // if } // if return $deleted; }
/** * Returns a peer instance associated with this om. * * Since Peer classes are not to have any instance attributes, this method returns the * same instance for all member of this class. The method could therefore * be static, but this would prevent one from overriding the behavior. * * @return CommentPeer */ public function getPeer() { if (self::$peer === null) { self::$peer = new CommentPeer(); } return self::$peer; }
public function delete(Doctrine_Connection $conn = null) { LuceneEngine::deleteLuceneIndexFor($this); return parent::delete($conn); }
public static function model($className = __CLASS__) { return parent::model($className); }
public function setUp() { $this->hasOne('sfGuardUser as User', array('local' => 'user_id', 'foreign' => 'id')); BaseComment::setUp(); }