Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
EmailContactDetail | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
label | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Drupal\crm\Entity\ContactDetail; |
6 | |
7 | /** |
8 | * A bundle class for crm_contact_detail entities. |
9 | */ |
10 | final class EmailContactDetail extends ContactDetailBase { |
11 | |
12 | /** |
13 | * {@inheritdoc} |
14 | */ |
15 | public function label() { |
16 | $type = parent::label(); |
17 | |
18 | /** @var \Drupal\email\Plugin\Field\FieldType\EmailItem $email */ |
19 | $label = $this->get('email')->first()->value; |
20 | |
21 | if ($type) { |
22 | $label = "$type: $label"; |
23 | } |
24 | |
25 | return $label; |
26 | } |
27 | |
28 | } |