getSectionPlugin example


  protected function prepareResults(StatementInterface $found) {
    $results = [];
    $plugins = [];
    $languages = [];
    $keys = $this->getKeywords();
    foreach ($found as $item) {
      $section_plugin_id = $item->section_plugin_id;
      if (!isset($plugins[$section_plugin_id])) {
        $plugins[$section_plugin_id] = $this->getSectionPlugin($section_plugin_id);
      }
      if ($plugins[$section_plugin_id]) {
        $langcode = $item->langcode;
        if (!isset($languages[$langcode])) {
          $languages[$langcode] = $this->languageManager->getLanguage($item->langcode);
        }
        $topic = $plugins[$section_plugin_id]->renderTopicForSearch($item->topic_id, $languages[$langcode]);
        if ($topic) {
          if (isset($topic['cacheable_metadata'])) {
            $this->addCacheableDependency($topic['cacheable_metadata']);
          }
          
Home | Imprint | This part of the site doesn't use cookies.