public function populateRecord($attributes, $callAfterFind = true) { if ($this->getPopulateMode()) { return parent::populateRecord($attributes, $callAfterFind); } else { return $attributes; } }
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); }
/** * 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; }
public function populateRecord($attributes, $callAfterFind = true) { return parent::populateRecord($attributes, false); }