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