/** * Transform an stdClass Object returned by history into a HistoryItem * @param $item */ public function __construct($item) { parent::__construct($item); $this->flags = new Flags($item->flags); $this->from = new User($item->from); $this->to = new User($item->to); }
public function __construct($key, $size = '', $last_modified = '', $etag = '') { parent::__construct(); if (is_array($key)) { $this->init_from_array($key); return $this; } $this->key = $key; $this->size = $size; $this->etag = $etag; $this->last_modified = $last_modified; return $this; }
/** * The class constructor * * Generate the AbstractBasicObject object from an json string, an array or * an object. * Whatever the input, we try to construct the basic object * * @param mixed $data Whatever we can use to create the basic object */ public function __construct($data = null) { // Si on n'est pas dans la classe 'BasicObject', alors on a // potentiellement des attributs et des propriétés à ajouter. Ce n'est // pas là qu'on tentera de récupérer les données. On appelle donc la // méthode parente $this->init(); if (!get_parent_class($this)) { parent::__construct($data); } else { // Création de l'objet à partir des données if (!is_null($data)) { $this->setFromSomeData($data); } } }
public function __construct() { parent::__construct(); return $this; }