Beispiel #1
0
 /**
  * The Enlight_Event_Handler_Plugin class constructor expects the event name.
  * All parameters are set in the internal properties.
  *
  * @throws  Enlight_Event_Exception
  * @param   string                   $event
  * @param   Enlight_Plugin_Namespace $namespace
  * @param   Enlight_Plugin_Bootstrap $plugin
  * @param   string                   $listener
  * @param   integer                  $position
  */
 public function __construct($event, $namespace = null, $plugin = null, $listener = null, $position = null)
 {
     if ($namespace !== null) {
         $this->setNamespace($namespace);
     }
     if ($plugin !== null) {
         $this->setPlugin($plugin);
     }
     if ($listener !== null) {
         $this->setListener($listener);
     }
     parent::__construct($event);
     $this->setPosition($position);
 }
Beispiel #2
0
 /**
  * The Enlight_Event_Handler_Default class constructor expects the event name, the callback function and
  * optional the position of the event handler.
  *
  * @throws  Enlight_Exception
  * @param   string   $event
  * @param   callback $listener
  * @param   integer  $position
  */
 public function __construct($event, $listener, $position = null)
 {
     parent::__construct($event);
     $this->setListener($listener);
     $this->setPosition($position);
 }