/** * Constructor * * @param KObjectConfig $config An optional ObjectConfig object with configuration options. */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Add the toolbars $toolbars = (array) KObjectConfig::unbox($config->toolbars); foreach ($toolbars as $key => $value) { if (is_numeric($key)) { $this->addToolbar($value); } else { $this->addToolbar($key, $value); } } }
/** * Object constructor * * @param KObjectConfig $config An optional ObjectConfig object with configuration options * @throws InvalidArgumentException */ public function __construct(KObjectConfig $config) { parent::__construct($config); if (is_null($config->event_publisher)) { throw new InvalidArgumentException('event_publisher [KEventPublisherInterface] config option is required'); } //Set the event dispatcher $this->__event_publisher = $config->event_publisher; //Add the event listeners foreach ($config->event_listeners as $event => $listener) { $this->addEventListener($event, $listener); } //Add the event subscribers $subscribers = (array) KObjectConfig::unbox($config->event_subscribers); foreach ($subscribers as $key => $value) { if (is_numeric($key)) { $this->addEventSubscriber($value); } else { $this->addEventSubscriber($key, $value); } } }
/** * Constructor * * @param KObjectConfig $config An optional KObjectConfig object with configuration options */ public function __construct(KObjectConfig $config) { parent::__construct($config); //Set the chain break condition $this->_break_condition = $config->break_condition; }