Optimize initialization of ECA-related Symfony events

Issue information

From user: mxh

Related to !10 (merged) !6 (closed)

Contribution record

Fork management

Problem/Motivation

The current implementation on how ECA-related events are being instantiated might introduce some unwanted overhead and limited flexibility.

For example, the eca_content.module file declares about 30 class usages that are mostly event classes:

<?php
use Drupal\eca_content\Event\ContentEntityBundleCreate;
use
Drupal\eca_content\Event\ContentEntityBundleDelete;
use
Drupal\eca_content\Event\ContentEntityCreate;
use
Drupal\eca_content\Event\ContentEntityDelete;
// ...
?>

Proposed resolution

Create a factory service that encapsulates that loading part. It may even dynamically use the already existing plugin definitions (that are coming from the ContentEntityEventDeriver in scope of eca_content).

Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information