class ExamplePreprocessEventFactory in Hook Event Dispatcher 8
Class ExamplePreprocessEventFactory.
Hierarchy
- class \Drupal\preprocess_example_module\Event\Factory\ExamplePreprocessEventFactory implements PreprocessEventFactoryInterface
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\FactoryView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExamplePreprocessEventFactory:: |
public | function |
Create the PreprocessEvent with the Variables object embedded. Overrides PreprocessEventFactoryInterface:: |
|
ExamplePreprocessEventFactory:: |
public | function |
Get the Event hook name. Overrides PreprocessEventFactoryInterface:: |