Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / paragraphs / src / ParagraphViewBuilder.php
1 <?php
2
3 namespace Drupal\paragraphs;
4
5 use Drupal\Core\Entity\Entity\EntityViewDisplay;
6 use Drupal\Core\Entity\EntityViewBuilder;
7
8 /**
9  * Render controller for paragraphs.
10  */
11 class ParagraphViewBuilder extends EntityViewBuilder {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function buildMultiple(array $build_list) {
17     $build_list = parent::buildMultiple($build_list);
18
19     // Allow enabled behavior plugin to alter the rendering.
20     foreach ($build_list as $key => $value) {
21       $display = EntityViewDisplay::load('paragraph.' . $value['#paragraph']->bundle() . '.' . $value['#view_mode']) ?: EntityViewDisplay::load('paragraph.' . $value['#paragraph']->bundle() . '.default');
22       $paragraph_type = $value['#paragraph']->getParagraphType();
23       foreach ($paragraph_type->getEnabledBehaviorPlugins() as $plugin_id => $plugin_value) {
24         $plugin_value->view($build_list[$key], $value['#paragraph'], $display, $value['#view_mode']);
25       }
26     }
27     return $build_list;
28   }
29
30 }