You are here

protected function PriceListListBuilder::getDefaultOperations in Commerce Pricelist 8.2

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/PriceListListBuilder.php, line 213

Class

PriceListListBuilder
Defines the list builder for price lists.

Namespace

Drupal\commerce_pricelist

Code

protected function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->access('update')) {
    $operations['prices'] = [
      'title' => $this
        ->t('Prices'),
      'url' => new Url('entity.commerce_pricelist_item.collection', [
        'commerce_pricelist' => $entity
          ->id(),
      ]),
    ];
  }
  return $operations;
}