You are here

class ExamplePreprocessEventFactory in Hook Event Dispatcher 8

Class ExamplePreprocessEventFactory.

Hierarchy

Expanded class hierarchy of ExamplePreprocessEventFactory

1 string reference to 'ExamplePreprocessEventFactory'
preprocess_example_module.services.yml in src/Example/preprocess_example_module/preprocess_example_module.services.yml
src/Example/preprocess_example_module/preprocess_example_module.services.yml
1 service uses ExamplePreprocessEventFactory
preprocess_event.factory.example in src/Example/preprocess_example_module/preprocess_example_module.services.yml
\Drupal\preprocess_example_module\Event\Factory\ExamplePreprocessEventFactory

File

src/Example/preprocess_example_module/src/Event/Factory/ExamplePreprocessEventFactory.php, line 12

Namespace

Drupal\preprocess_example_module\Event\Factory
View source
class ExamplePreprocessEventFactory implements PreprocessEventFactoryInterface {

  /**
   * Create the PreprocessEvent with the Variables object embedded.
   *
   * @param array $variables
   *   Variables.
   *
   * @return \Drupal\hook_event_dispatcher\Event\Preprocess\AbstractPreprocessEvent
   *   Created event.
   */
  public function createEvent(array &$variables) {
    return new ExamplePreprocessEvent(new ExampleEventVariables($variables));
  }

  /**
   * {@inheritdoc}
   */
  public function getEventHook() {
    return ExamplePreprocessEvent::getHook();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExamplePreprocessEventFactory::createEvent public function Create the PreprocessEvent with the Variables object embedded. Overrides PreprocessEventFactoryInterface::createEvent
ExamplePreprocessEventFactory::getEventHook public function Get the Event hook name. Overrides PreprocessEventFactoryInterface::getEventHook