| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function buildRow(EntityInterface $entity) { |
||
| 31 | /** @var \Drupal\embed\EmbedButtonInterface $entity */ |
||
| 32 | $row = []; |
||
| 33 | $row['label'] = $entity->label(); |
||
| 34 | $row['embed_type'] = $entity->getTypeLabel(); |
||
| 35 | if ($icon_url = $entity->getIconUrl()) { |
||
| 36 | $row['icon']['data'] = [ |
||
| 37 | '#theme' => 'image', |
||
| 38 | '#uri' => $icon_url, |
||
| 39 | '#alt' => $this->t('Icon for the @label button.', ['@label' => $entity->label()]), |
||
| 40 | ]; |
||
| 41 | } |
||
| 42 | else { |
||
| 43 | $row['icon'] = $this->t('None'); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $row + parent::buildRow($entity); |
||
| 47 | } |
||
| 48 | |||
| 50 |