You are here

class EdgeEntityUpdateEventDeriver in Apigee Edge 8

Deriver for Edge entity update events.

Hierarchy

Expanded class hierarchy of EdgeEntityUpdateEventDeriver

1 string reference to 'EdgeEntityUpdateEventDeriver'
apigee_edge_actions.rules.events.yml in modules/apigee_edge_actions/apigee_edge_actions.rules.events.yml
modules/apigee_edge_actions/apigee_edge_actions.rules.events.yml

File

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

Namespace

Drupal\apigee_edge_actions\Plugin\RulesEvent
View source
class EdgeEntityUpdateEventDeriver extends EdgeEntityEventDeriverBase {

  /**
   * {@inheritdoc}
   */
  public function getLabel(EdgeEntityTypeInterface $entity_type) : string {
    return $this
      ->t('After updating a @entity_type', [
      '@entity_type' => $entity_type
        ->getSingularLabel(),
    ]);
  }

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
EdgeEntityEventDeriverBase::$edgeEntityTypeManager protected property The apigee app entity type manager service.
EdgeEntityEventDeriverBase::create public static function Creates a new class instance. Overrides ContainerDeriverInterface::create
EdgeEntityEventDeriverBase::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions
EdgeEntityEventDeriverBase::getEntityTypes public function Returns an array of entity types that are compatible to this event. Overrides EdgeEntityEventDeriverInterface::getEntityTypes 3
EdgeEntityEventDeriverBase::__construct public function AppEventDeriver constructor.
EdgeEntityUpdateEventDeriver::getContext public function Returns an array of event context. Overrides EdgeEntityEventDeriverBase::getContext
EdgeEntityUpdateEventDeriver::getLabel public function Returns the event's label. Example: 'After saving a new App'. Overrides EdgeEntityEventDeriverInterface::getLabel
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.