You are here

public function OgMenuListBuilder::getDefaultOperations in Organic Groups Menu (OG Menu) 8

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 ConfigEntityListBuilder::getDefaultOperations

File

src/OgMenuListBuilder.php, line 34

Class

OgMenuListBuilder
Provides a listing of OG Menu entities.

Namespace

Drupal\og_menu

Code

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