Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 public function save(Doctrine_Connection $conn = null)
 {
     $conn = $conn ? $conn : $this->getTable()->getConnection();
     $conn->beginTransaction();
     try {
         $ret = parent::save($conn);
         if (!$this->location_id && !$this->profit_id && !$this->fish_event_id || $this->location_id && $this->getLocation()->location_scope_id == 5 || $this->profit_id && $this->getProfit()->getLocation()->location_scope_id == 5 || $this->fish_event_id && $this->getFishEvent()->getLocation()->location_scope_id == 5) {
             LuceneEngine::updateLuceneIndexFor($this);
         }
         $conn->commit();
         return $ret;
     } catch (Exception $e) {
         $conn->rollBack();
         throw $e;
     }
 }
Exemplo n.º 4
0
 /**
  * Save the object
  *
  * @param void
  * @return boolean
  */
 function save()
 {
     $is_new = $this->isNew();
     $saved = parent::save();
     if ($saved) {
         $object = $this->getObject();
         if ($object instanceof ProjectDataObject) {
             if ($is_new) {
                 $object->onAddComment($this);
             } else {
                 $object->onEditComment($this);
             }
             // if
         }
         // if
     }
     // if
     return $saved;
 }
Exemplo n.º 5
0
	/**
	 * Save the object
	 *
	 * @param void
	 * @return boolean
	 */
	function save() {
		$is_new = $this->isNew();
		$saved = parent::save();
		if($saved) {
			$object = $this->getRelObject();
			
			if($object instanceof ContentDataObject) {
				if($is_new) {
					$object->onAddComment($this);
				} else {
					$object->onEditComment($this);
				}
				$object->save();
			}
		}
		return $saved;
	}