protected EntityListBuilder::getDefaultOperations(EntityInterface $entity)
Gets this list's default operations.
\Drupal\Core\Entity\EntityInterface $entity: The entity the operations are for.
array The array structure is identical to the return value of self::getOperations().
protected function getDefaultOperations(EntityInterface $entity) { $operations = array(); if ($entity->access('update') && $entity->hasLinkTemplate('edit-form')) { $operations['edit'] = array( 'title' => $this->t('Edit'), 'weight' => 10, 'url' => $entity->urlInfo('edit-form'), ); } if ($entity->access('delete') && $entity->hasLinkTemplate('delete-form')) { $operations['delete'] = array( 'title' => $this->t('Delete'), 'weight' => 100, 'url' => $entity->urlInfo('delete-form'), ); } return $operations; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityListBuilder.php/function/EntityListBuilder::getDefaultOperations/8.1.x