public function save(Doctrine_Connection $conn = null) { if (is_null($conn)) { $conn = opDoctrineQuery::chooseConnection(true); } parent::save($conn); }
public function save(Doctrine_Connection $conn = null) { $hasConnection = Doctrine_Manager::getInstance()->hasConnectionForComponent($this->getTable()->getComponentName()); if (is_null($conn) && !$hasConnection) { $conn = opDoctrineQuery::chooseConnection(true); } parent::save($conn); }
/** * * @param sfDoctrineRecord $review * @return PerformanceReview */ public function saveReview(sfDoctrineRecord $review) { try { $review->save(); $review->refresh(); return $review; //@codeCoverageIgnoreStart } catch (Exception $e) { throw new DaoException($e->getMessage(), $e->getCode(), $e); } //@codeCoverageIgnoreEnd }
public function save(Doctrine_Connection $conn = null) { parent::save($conn); foreach ($this->array_object as $object) { $object->setReferencedRelation($this->getTable()->getTableName()); $object->setRecordId($this->id); try { $object->save(); } catch (Doctrine_Exception $ne) { $e = new DarwinPgErrorParser($ne); $this->array_errors[] = "Unit " . $this->getTable()->getTableName() . " object were not saved: " . $e->getMessage() . ";"; } } return $this->array_errors; }
/** * * @param sfDoctrineRecord $kpi * @return \sfDoctrineRecord * @throws DaoException */ public function saveKpi(sfDoctrineRecord $kpi) { try { if ($kpi->getDefaultKpi() > 0) { $query = Doctrine_Query::create()->update('Kpi k')->set('default_kpi', 'null'); $query->execute(); } $kpi->save(); $kpi->refresh(); return $kpi; //@codeCoverageIgnoreStart } catch (Exception $e) { throw new DaoException($e->getMessage(), $e->getCode(), $e); } //@codeCoverageIgnoreEnd }