public function ClientListBuilder::getDefaultOperations in OAuth2 Server 8
Same name and namespace in other branches
- 2.0.x src/ClientListBuilder.php \Drupal\oauth2_server\ClientListBuilder::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 ConfigEntityListBuilder::getDefaultOperations
File
- src/
ClientListBuilder.php, line 21
Class
- ClientListBuilder
- Builds a listing of oauth2 server client entities.
Namespace
Drupal\oauth2_serverCode
public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
if ($entity instanceof ClientInterface) {
$route_parameters['oauth2_server'] = $entity
->getServer()
->id();
$route_parameters['oauth2_server_client'] = $entity
->id();
$operations['edit'] = [
'title' => $this
->t('Edit'),
'weight' => 20,
'url' => new Url('entity.oauth2_server.clients.edit_form', $route_parameters),
];
$operations['delete'] = [
'title' => $this
->t('Delete'),
'weight' => 30,
'url' => new Url('entity.oauth2_server.clients.delete_form', $route_parameters),
];
}
return $operations;
}