- Issue created by @geek-merlin
When playing with this on an existing code base, i would often have needed this.
Typically when altering a plugin, but any class that does NOT get instantiated by the container, will do:
final class MyCustomEntityPrintClass extends PhpWkhtmlToPdf {
/**
* We can NOT put this hook into its class currently, as the container can not (and should not) create an instance.
*/
#[Alter('entity_print_print_engine')]
public static function alterEntityPrintPrintEngine(&$info) {
$info['phpwkhtmltopdf']['class'] = self::class;
}
/**
* Constructor called by plugin manager.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, ExportTypeInterface $export_type) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $export_type);
// My custom code.
}
}
Allow static hooks, and call them statically.
Active
1.0
Code
Enhances developer experience.