本文整理匯總了PHP中sfDoctrineRecord::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP sfDoctrineRecord::set方法的具體用法?PHP sfDoctrineRecord::set怎麽用?PHP sfDoctrineRecord::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sfDoctrineRecord
的用法示例。
在下文中一共展示了sfDoctrineRecord::set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadRefEntityDefaults
/**
* When ever we find a refClass, it may introduce trouble if it has more fields
* than just the two related foreign keys. For such situations valid default
* values should be provided.
*
* @param string $entName The entity name as in record definition config.
* @param string $relName The relation name as in record definition config.
* @param sfDoctrineRecord $refEntity The new entity acting as a refclass
* @param array $recordDef This record definition.
*
* @return void
*/
protected static function loadRefEntityDefaults($entName, $relName, sfDoctrineRecord $refEntity, array $recordDef)
{
if (isset($recordDef['entities'][$entName]['relations'][$relName]['refClassDefaults']) && !empty($recordDef['entities'][$entName]['relations'][$relName]['refClassDefaults'])) {
$columns = $recordDef['entities'][$entName]['relations'][$relName]['refClassDefaults'];
foreach ($columns as $colName => $defVal) {
$refEntity->set($colName, self::getDefault($defVal));
}
}
}
示例2: set
public function set($name, $value, $load = true)
{
if (in_array($name, $this->getI18nColumns())) {
$obj = $this->getCurrentI18nObject(true);
$obj->set($name, $value, $load);
} else {
parent::set($name, $value, $load);
}
}