You are here

public function WebformCompositeListBuilder::getDefaultOperations in Webform Composite Tools 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/Controller/WebformCompositeListBuilder.php, line 75

Class

WebformCompositeListBuilder
Provides a listing of Reusable Webform Composites entities.

Namespace

Drupal\webform_composite\Controller

Code

public function getDefaultOperations(EntityInterface $entity) {

  // Add an operation for viewing source of composites.
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->access('update') && $entity
    ->hasLinkTemplate('source-form')) {
    $operations['source'] = array(
      'title' => $this
        ->t('Source'),
      'weight' => 10,
      'url' => $entity
        ->toUrl('source-form'),
    );
  }
  return $operations;
}