Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 12 |
| BlockContentListBuilder | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 12 |
| buildHeader | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| buildRow | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
| getDefaultOperations | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 6 |
|||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\block_content\BlockContentListBuilder. | |
| */ | |
| namespace Drupal\block_content; | |
| use Drupal\Core\Entity\EntityInterface; | |
| use Drupal\Core\Entity\EntityListBuilder; | |
| /** | |
| * Defines a class to build a listing of custom block entities. | |
| * | |
| * @see \Drupal\block_content\Entity\BlockContent | |
| */ | |
| class BlockContentListBuilder extends EntityListBuilder { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function buildHeader() { | |
| $header['label'] = t('Block description'); | |
| return $header + parent::buildHeader(); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function buildRow(EntityInterface $entity) { | |
| $row['label'] = $entity->label(); | |
| return $row + parent::buildRow($entity); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getDefaultOperations(EntityInterface $entity) { | |
| $operations = parent::getDefaultOperations($entity); | |
| if (isset($operations['edit'])) { | |
| $operations['edit']['query']['destination'] = $entity->url('collection'); | |
| } | |
| return $operations; | |
| } | |
| } |