本文整理汇总了PHP中sfDoctrineRecord::save方法的典型用法代码示例。如果您正苦于以下问题:PHP sfDoctrineRecord::save方法的具体用法?PHP sfDoctrineRecord::save怎么用?PHP sfDoctrineRecord::save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfDoctrineRecord
的用法示例。
在下文中一共展示了sfDoctrineRecord::save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(Doctrine_Connection $conn = null)
{
if (is_null($conn)) {
$conn = opDoctrineQuery::chooseConnection(true);
}
parent::save($conn);
}
示例2: save
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);
}
示例3: saveReview
/**
*
* @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
}
示例4: save
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;
}
示例5: saveKpi
/**
*
* @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
}