/**
  * Constructor
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *                             Recognized key values include 'name', 'group', 'params', 'language'
  *                             (this list is not meant to be comprehensive).
  *
  * @since   11.1
  */
 public function __construct(&$subject, $config = array())
 {
     // Get the parameters.
     if (isset($config['params'])) {
         if ($config['params'] instanceof Registry) {
             $this->params = $config['params'];
         } else {
             $this->params = new Registry();
             $this->params->loadString($config['params']);
         }
     }
     // Get the plugin name.
     if (isset($config['name'])) {
         $this->_name = $config['name'];
     }
     // Get the plugin type.
     if (isset($config['type'])) {
         $this->_type = $config['type'];
     }
     parent::__construct($subject);
 }
Beispiel #2
0
 /**
  * Constructor. Overridden to go through the argument setters.
  *
  * @param   string  $name       The event name.
  * @param   array   $arguments  The event arguments.
  *
  * @since   __DEPLOY_VERSION__
  */
 public function __construct($name, array $arguments = array())
 {
     parent::__construct($name, $arguments);
     $this->arguments = [];
     foreach ($arguments as $argumentName => $value) {
         $this->setArgument($argumentName, $value);
     }
 }
 /**
  * RenderContentTypeEvent constructor.
  *
  * @param   string               $type     The name of the content type
  * @param   ContentTypeInterface $content  The content element
  */
 public function __construct($type, $content)
 {
     parent::__construct('onBeforeRender' . $type, ['type' => $type, 'content' => $content]);
 }
 /**
  * RegisterContentTypeFailureEvent constructor.
  *
  * @param   string      $type       The name of the content type
  * @param   \Exception  $exception  The exception
  */
 public function __construct($type, $exception)
 {
     parent::__construct('onRegisterContentTypeFailure', ['type' => $type, 'exception' => $exception]);
 }
Beispiel #5
0
 /**
  * Constructor.
  *
  * @param   string            $name     The event name.
  * @param   SessionInterface  $session  The SessionInterface object for this event.
  *
  * @since   __DEPLOY_VERSION__
  */
 public function __construct($name, SessionInterface $session)
 {
     parent::__construct($name);
     $this->session = $session;
 }
 /**
  * RenderContentTypeFailureEvent constructor.
  *
  * @param   string      $type       The name of the content type
  * @param   \Exception  $exception  The exception
  */
 public function __construct($type, $exception)
 {
     parent::__construct('onRender' . $type . 'Failure', ['type' => $type, 'exception' => $exception]);
 }
 /**
  * RenderContentTypeSuccessEvent constructor.
  *
  * @param   string           $type    The name of the content type
  * @param   StreamInterface  $stream  The stream to which the content is added
  */
 public function __construct($type, $stream)
 {
     parent::__construct('onAfter' . $type, ['type' => $type, 'stream' => $stream]);
 }
 /**
  * DefinitionCreatedEvent constructor.
  *
  * @param   string        $entityClass The class of the entity
  * @param   Entity        $definition  The definition
  * @param   EntityBuilder $builder     The builder
  */
 public function __construct($entityClass, Entity $definition, EntityBuilder $builder)
 {
     parent::__construct('onDefinitionCreated', ['entityClass' => $entityClass, 'definition' => $definition, 'builder' => $builder]);
 }
 /**
  * DefinitionCreatedEvent constructor.
  *
  * @param   string        $entityName The name of the entity
  * @param   EntityBuilder $builder    The builder
  */
 public function __construct($entityName, EntityBuilder $builder)
 {
     parent::__construct('onCreateDefinition', ['className' => $entityName, 'builder' => $builder]);
 }
 /**
  * QueryDatabaseEvent constructor.
  *
  * @param   string       $entityClass The class of the entity
  * @param   QueryBuilder $builder     The query builder
  */
 public function __construct($entityClass, QueryBuilder $builder)
 {
     parent::__construct('onQueryDatabase', ['entityClass' => $entityClass, 'query' => $builder]);
 }
 /**
  * RegisterContentTypeEvent constructor.
  *
  * @param   string    $type     The name of the content type
  * @param   callable  $handler  The content type handler
  */
 public function __construct($type, $handler)
 {
     parent::__construct('onBeforeRegisterContentType', ['type' => $type, 'handler' => $handler]);
 }