You are here

public function QueueListBuilder::getDefaultOperations in Advanced Queue 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/QueueListBuilder.php, line 47

Class

QueueListBuilder
Defines the list builder for queues.

Namespace

Drupal\advancedqueue

Code

public function getDefaultOperations(EntityInterface $entity) {

  /** @var \Drupal\advancedqueue\Entity\QueueInterface $entity */
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->getBackendId() === 'database') {
    $operations['jobs'] = [
      'title' => $this
        ->t('List jobs'),
      'weight' => -20,
      'url' => Url::fromRoute('view.advancedqueue_jobs.page_1', [
        'arg_0' => $entity
          ->id(),
      ]),
    ];
  }
  return $operations;
}