Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
CrmCaseEncounterListBuilder | |
0.00% |
0 / 8 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
buildHeader | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
buildRow | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Drupal\crm_case; |
4 | |
5 | use Drupal\Core\Config\Entity\ConfigEntityListBuilder; |
6 | use Drupal\Core\Entity\EntityInterface; |
7 | |
8 | /** |
9 | * Provides a listing of encounters. |
10 | */ |
11 | class CrmCaseEncounterListBuilder extends ConfigEntityListBuilder { |
12 | |
13 | /** |
14 | * {@inheritdoc} |
15 | */ |
16 | public function buildHeader() { |
17 | $header['label'] = $this->t('Label'); |
18 | $header['id'] = $this->t('Machine name'); |
19 | $header['status'] = $this->t('Status'); |
20 | return $header + parent::buildHeader(); |
21 | } |
22 | |
23 | /** |
24 | * {@inheritdoc} |
25 | */ |
26 | public function buildRow(EntityInterface $entity) { |
27 | /** @var \Drupal\crm_case\CrmCaseEncounterInterface $entity */ |
28 | $row['label'] = $entity->label(); |
29 | $row['id'] = $entity->id(); |
30 | $row['status'] = $entity->status() ? $this->t('Enabled') : $this->t('Disabled'); |
31 | return $row + parent::buildRow($entity); |
32 | } |
33 | |
34 | } |