You are here

public function EdgeEntityUpdateEventDeriver::getContext in Apigee Edge 8

Returns an array of event context.

Parameters

\Drupal\apigee_edge\Entity\EdgeEntityTypeInterface $entity_type: The Apigee Edge entity type.

Return value

array An array of event context.

Overrides EdgeEntityEventDeriverBase::getContext

File

modules/apigee_edge_actions/src/Plugin/RulesEvent/EdgeEntityUpdateEventDeriver.php, line 40

Class

EdgeEntityUpdateEventDeriver
Deriver for Edge entity update events.

Namespace

Drupal\apigee_edge_actions\Plugin\RulesEvent

Code

public function getContext(EdgeEntityTypeInterface $entity_type) : array {
  $context = parent::getContext($entity_type);

  // Add the original entity to the context.
  $context["{$entity_type->id()}_unchanged"] = [
    'type' => "entity:{$entity_type->id()}",
    'label' => $this
      ->t('Unchanged @entity_type', [
      '@entity_type' => $entity_type
        ->getLabel(),
    ]),
  ];
  return $context;
}