You are here

public function MentionsConfigListBuilder::getDefaultOperations in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  2. 8.2 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  3. 8.3 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  4. 8.4 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  5. 8.5 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  6. 8.6 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  7. 8.7 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  8. 8.8 modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  9. 10.3.x modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  10. 10.0.x modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  11. 10.1.x modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()
  12. 10.2.x modules/custom/mentions/src/MentionsConfigListBuilder.php \Drupal\mentions\MentionsConfigListBuilder::getDefaultOperations()

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

modules/custom/mentions/src/MentionsConfigListBuilder.php, line 39

Class

MentionsConfigListBuilder
Provides a listing of Mentions Type entities.

Namespace

Drupal\mentions

Code

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