loadFromRecord (   $record)

Loads a IcesDBObject from it record.

The record may come from the database (when retrieving an existing instance) or from user input (when creating a new instance).

Parámetros
array$recordAn associative array with the parameters of the object.
Devuelve
IcesDBObject A loaded object from its database record.

Hace referencia a handleSerialized().

Referenciado por load().

80  {
81  $this->handleSerialized($record);
82  if (isset($record['classname']) && class_exists($record['classname']) && is_subclass_of($record['classname'], $this->classname)) {
83  $obj = new $record['classname']($record);
84  }
85  else {
86  $obj = new $this->classname($record);
87  }
88  if (!empty($record['decoration']) && is_array($record['decoration'])) {
89  // Load decorator pattern.
90  foreach ($record['decoration'] as $value) {
91  if (isset($value['classname']) && class_exists($value['classname'])) {
92  $obj = new $value['classname']($obj, $value['data']);
93  }
94  }
95  }
96  return $obj;
97  }
handleSerialized(array &$record)
Unserializes serialized database record fields.
Definition: common.db.logic.inc:290