本文整理汇总了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);
}
}