Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / aggregator / src / ItemViewBuilder.php
1 <?php
2
3 namespace Drupal\aggregator;
4
5 use Drupal\Core\Entity\EntityViewBuilder;
6
7 /**
8  * View builder handler for aggregator feed items.
9  */
10 class ItemViewBuilder extends EntityViewBuilder {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function buildComponents(array &$build, array $entities, array $displays, $view_mode) {
16     parent::buildComponents($build, $entities, $displays, $view_mode);
17
18     foreach ($entities as $id => $entity) {
19       $bundle = $entity->bundle();
20       $display = $displays[$bundle];
21
22       if ($display->getComponent('description')) {
23         $build[$id]['description'] = [
24           '#markup' => $entity->getDescription(),
25           '#allowed_tags' => _aggregator_allowed_tags(),
26           '#prefix' => '<div class="item-description">',
27           '#suffix' => '</div>',
28         ];
29       }
30     }
31   }
32
33 }