class ExamplePreprocessEventFactory in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 examples/preprocess_example_module/src/Factory/ExamplePreprocessEventFactory.php \Drupal\preprocess_example_module\Factory\ExamplePreprocessEventFactory
Class ExamplePreprocessEventFactory.
Hierarchy
- class \Drupal\preprocess_example_module\Factory\ExamplePreprocessEventFactory implements PreprocessEventFactoryInterface
Expanded class hierarchy of ExamplePreprocessEventFactory
1 string reference to 'ExamplePreprocessEventFactory'
- preprocess_example_module.services.yml in examples/
preprocess_example_module/ preprocess_example_module.services.yml - examples/preprocess_example_module/preprocess_example_module.services.yml
1 service uses ExamplePreprocessEventFactory
- preprocess_event.factory.example in examples/
preprocess_example_module/ preprocess_example_module.services.yml - Drupal\preprocess_example_module\Factory\ExamplePreprocessEventFactory
File
- examples/
preprocess_example_module/ src/ Factory/ ExamplePreprocessEventFactory.php, line 13
Namespace
Drupal\preprocess_example_module\FactoryView source
class ExamplePreprocessEventFactory implements PreprocessEventFactoryInterface {
/**
* Create the PreprocessEvent with the Variables object embedded.
*
* @param array $variables
* Variables.
*
* @return \Drupal\preprocess_event_dispatcher\Event\AbstractPreprocessEvent
* Created event.
*/
public function createEvent(array &$variables) : AbstractPreprocessEvent {
return new ExamplePreprocessEvent(new ExampleEventVariables($variables));
}
/**
* {@inheritdoc}
*/
public function getEventHook() : string {
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:: |