You are here

protected function RegistrationListBuilder::getDefaultOperations in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Lists/RegistrationListBuilder.php \Drupal\rng\Lists\RegistrationListBuilder::getDefaultOperations()
  2. 3.x src/Lists/RegistrationListBuilder.php \Drupal\rng\Lists\RegistrationListBuilder::getDefaultOperations()

Gets this list's default operations.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.

Return value

array The array structure is identical to the return value of self::getOperations().

Overrides EntityListBuilder::getDefaultOperations

File

src/Lists/RegistrationListBuilder.php, line 90

Class

RegistrationListBuilder
Builds a list of registrations.

Namespace

Drupal\rng\Lists

Code

protected function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->access('view') && $entity
    ->hasLinkTemplate('canonical')) {
    $operations['view'] = array(
      'title' => $this
        ->t('View'),
      'weight' => 0,
      'url' => $entity
        ->urlInfo('canonical'),
    );
  }
  return $operations;
}