You are here

public function CustomLanguageListBuilder::getDefaultOperations in Custom Language field 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/CustomLanguageListBuilder.php, line 48

Class

CustomLanguageListBuilder
Defines a class to build a listing of Custom Languages.

Namespace

Drupal\languagefield

Code

public function getDefaultOperations(EntityInterface $entity) {
  $operations = parent::getDefaultOperations($entity);
  if ($entity
    ->hasLinkTemplate('edit-form')) {
    $operations['edit'] = [
      'title' => $this
        ->t('Edit'),
      'weight' => 20,
      'url' => $entity
        ->toUrl('edit-form'),
    ];
  }
  return $operations;
}