You are here

function rng_entity_operation in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 rng.module \rng_entity_operation()
  2. 3.x rng.module \rng_entity_operation()

Implements hook_entity_operation().

File

./rng.module, line 54

Code

function rng_entity_operation(EntityInterface $entity) {
  $operations = [];
  if ($entity instanceof EventTypeInterface) {
    $operations['access_defaults'] = array(
      'title' => t('Event access defaults'),
      'url' => Url::fromRoute('entity.event_type.access_defaults', [
        'event_type' => $entity
          ->id(),
      ]),
      'weight' => 20,
    );
  }
  return $operations;
}