You are here

public function EdgeEntityProductEventDeriverBase::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/EdgeEntityProductEventDeriverBase.php, line 46

Class

EdgeEntityProductEventDeriverBase
Base deriver for Edge entity product events.

Namespace

Drupal\apigee_edge_actions\Plugin\RulesEvent

Code

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

  // The api_product entity type is not fieldable hence does not support typed
  // data. We have to add the attributes individually here.
  $context['api_product_name'] = [
    'type' => 'string',
    'label' => $this
      ->t('Name'),
  ];
  $context['api_product_display_name'] = [
    'type' => 'string',
    'label' => $this
      ->t('Display name'),
  ];
  return $context;
}