You are here

protected function ShipmentListBuilder::getDefaultOperations in Commerce Shipping 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/ShipmentListBuilder.php, line 126

Class

ShipmentListBuilder
Defines the list builder for shipments.

Namespace

Drupal\commerce_shipping

Code

protected function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->getOrder()
    ->access('resend_receipt')) {
    $operations['resend_confirmation'] = [
      'title' => $this
        ->t('Resend confirmation'),
      'weight' => 20,
      'url' => $entity
        ->toUrl('resend-confirmation-form'),
    ];
  }
  return $operations;
}