You are here

protected function DeveloperAppListBuilderForDeveloper::getDefaultOperations in Apigee Edge 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 AppListBuilder::getDefaultOperations

File

src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php, line 145

Class

DeveloperAppListBuilderForDeveloper
Lists developer apps of a developer on the UI.

Namespace

Drupal\apigee_edge\Entity\ListBuilder

Code

protected function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  foreach ($operations as $operation => $parameters) {
    if ($entity
      ->hasLinkTemplate("{$operation}-for-developer")) {
      $operations[$operation]['url'] = $entity
        ->toUrl("{$operation}-for-developer");
    }
    if ($entity
      ->hasLinkTemplate("{$operation}-form-for-developer")) {
      $operations[$operation]['url'] = $this
        ->ensureDestination($entity
        ->toUrl("{$operation}-form-for-developer"));
    }
  }
  return $operations;
}