Example #1
0
 public function populateRecord($attributes, $callAfterFind = true)
 {
     if ($this->getPopulateMode()) {
         return parent::populateRecord($attributes, $callAfterFind);
     } else {
         return $attributes;
     }
 }
Example #2
0
File: Row.php Project: cebe/chive
 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);
 }
Example #3
0
 /**
  * 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);
 }