protected EntityListBuilder::getDefaultOperations(EntityInterface $entity)
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().
File
- core/lib/Drupal/Core/Entity/EntityListBuilder.php, line 140
Class
- EntityListBuilder
- Defines a generic implementation to build a listing of entities.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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 ; } |
Please login to continue.