protected function _initObject($object) { parent::_initObject($object); // trigger init event $this->app->event->dispatcher->notify($this->app->event->create($object, 'cartitem:init')); return $object; }
protected function _initObject($object) { parent::_initObject($object); // workaround for php bug, which calls constructor before filling values if (is_string($object->params) || is_null($object->params)) { // decorate data as object $object->params = $this->app->parameter->create($object->params); } if (is_string($object->elements) || is_null($object->elements)) { // decorate data as object $object->elements = $this->app->data->create($object->elements); } // add to cache $key_name = $this->key; if ($object->{$key_name} && !key_exists($object->{$key_name}, $this->_objects)) { $this->_objects[$object->{$key_name}] = $object; } // trigger init event $this->app->event->dispatcher->notify($this->app->event->create($object, 'address:init')); return $object; }