Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 16 |
| ShortcutSetListBuilder | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 16 |
| buildHeader | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| getDefaultOperations | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 10 |
|||
| buildRow | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\shortcut\ShortcutSetListBuilder. | |
| */ | |
| namespace Drupal\shortcut; | |
| use Drupal\Core\Config\Entity\ConfigEntityListBuilder; | |
| use Drupal\Core\Entity\EntityInterface; | |
| /** | |
| * Defines a class to build a listing of shortcut set entities. | |
| * | |
| * @see \Drupal\shortcut\Entity\ShortcutSet | |
| */ | |
| class ShortcutSetListBuilder extends ConfigEntityListBuilder { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function buildHeader() { | |
| $header['name'] = t('Name'); | |
| return $header + parent::buildHeader(); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getDefaultOperations(EntityInterface $entity) { | |
| $operations = parent::getDefaultOperations($entity); | |
| if (isset($operations['edit'])) { | |
| $operations['edit']['title'] = t('Edit shortcut set'); | |
| } | |
| $operations['list'] = array( | |
| 'title' => t('List links'), | |
| 'url' => $entity->urlInfo('customize-form'), | |
| ); | |
| return $operations; | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function buildRow(EntityInterface $entity) { | |
| $row['name'] = $entity->label(); | |
| return $row + parent::buildRow($entity); | |
| } | |
| } |