本文整理汇总了PHP中CActiveRecord::populateRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::populateRecord方法的具体用法?PHP CActiveRecord::populateRecord怎么用?PHP CActiveRecord::populateRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::populateRecord方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateRecord
public function populateRecord($attributes, $callAfterFind = true)
{
if ($this->getPopulateMode()) {
return parent::populateRecord($attributes, $callAfterFind);
} else {
return $attributes;
}
}
示例2: populateRecord
public function populateRecord($attributes, $callAfterFind = true)
{
$table = $this->getMetaData()->tableSchema;
foreach ($table->columns as $column) {
if (DataType::getInputType($column->dbType) != "file") {
if (isset($attributes[$column->name])) {
SqlUtil::FixValue($attributes[$column->name]);
}
}
}
return parent::populateRecord($attributes, $callAfterFind);
}
示例3: populateRecord
/**
* Creates an active record with the given attributes.
* This method is internally used by the find methods.
* @param array $attributes attribute values (column name=>column value)
* @param boolean $callAfterFind whether to call {@link afterFind} after the record is populated.
* @return CActiveRecord the newly created active record. The class of the object is the same as the model class.
* Null is returned if the input data is false.
*/
public function populateRecord($attributes, $callAfterFind = true)
{
$record = parent::populateRecord($attributes, $callAfterFind);
if (is_subclass_of($record, 'ActiveRecord')) {
foreach ($attributes as $k => $a) {
if (!isset($record->{$k})) {
$record->{$k} = $a;
}
}
}
return $record;
}
示例4: populateRecord
public function populateRecord($attributes, $callAfterFind = true)
{
return parent::populateRecord($attributes, false);
}