I’m on Drupal 9. I’m trying to edit the ProductVariationAccessControlHandler
class of Commerce.
The class extends DrupalCoreEntityEntityAccessControlHandler
which in turn extends the abstract class EntityHandlerBase
This abstract class use the DependencySerializationTrait
trait.
Now, I want to inject a new service inside ProductVariationAccessControlHandler
. The parent class has a __construct
method:
/** * Constructs an access control handler instance. * * @param DrupalCoreEntityEntityTypeInterface $entity_type * The entity type definition. */ public function __construct(EntityTypeInterface $entity_type) { $this->entityTypeId = $entity_type->id(); $this->entityType = $entity_type; }
I’ve searched, but found no documentation nor understood what is the way to use that "trait" in order to inject another service – e.g. entity_type.manager.