function MenuLinkListBuilder::getDefaultOperations
Same name and namespace in other branches
- 10 core/modules/menu_link_content/src/MenuLinkListBuilder.php \Drupal\menu_link_content\MenuLinkListBuilder::getDefaultOperations()
Gets this list's default operations.
@todo Uncomment new method parameters before drupal:12.0.0.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for. phpcs:disable Drupal.Commenting
\Drupal\Core\Cache\CacheableMetadata|null $cacheability: The cacheable metadata to add to if your operations vary by or depend on something. phpcs:enable
Return value
array The array structure is identical to the return value of self::getOperations().
Overrides EntityListBuilder::getDefaultOperations
File
-
core/
modules/ menu_link_content/ src/ MenuLinkListBuilder.php, line 54
Class
- MenuLinkListBuilder
- Provides a menu link list builder.
Namespace
Drupal\menu_link_contentCode
public function getDefaultOperations(EntityInterface $entity) {
$operations = parent::getDefaultOperations($entity);
$destination = $this->redirectDestination
->get();
foreach ($operations as $key => $operation) {
$operations[$key]['query']['destination'] = $destination;
}
return $operations;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.