本文整理匯總了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
}