/**
  * Builds the overview of the licence entities.
  *
  * This is mimicking the rdf_entity's overview builder class.
  *
  * @see Drupal\rdf_entity\Entity\Controller\RdfListBuilder
  *
  * @return string
  *   Return Hello string.
  */
 public function overview()
 {
     $query = $this->entityStorage->getQuery()->condition('rid', 'licence');
     $header = $this->buildHeader();
     $query->tableSort($header);
     $rids = $query->execute();
     $licences = Rdf::loadMultiple($rids);
     $rows = [];
     foreach ($licences as $licence) {
         $rows[] = $this->buildRow($licence);
     }
     $build['table'] = array('#type' => 'table', '#header' => $this->buildHeader(), '#rows' => array(), '#empty' => $this->t('There are no licences yet.'));
     foreach ($licences as $licence) {
         if ($row = $this->buildRow($licence)) {
             $build['table']['#rows'][$licence->id()] = $row;
         }
     }
     return $build;
 }
 /**
  * {@inheritdoc}
  */
 public function build()
 {
     // If the page is not a solution page, return an empty form so that the
     // rendering of this block can be omitted.
     if (empty($this->solution) || $this->solution->bundle() != 'solution') {
         return [];
     }
     // Get news referencing to this solution.
     // @todo EntityManager is deprecated. Use EntityTypeManager instead.
     // @see https://webgate.ec.europa.eu/CITnet/jira/browse/ISAICP-2669
     $entities = $this->entityManager->getStorage('node')->loadByProperties([OgGroupAudienceHelperInterface::DEFAULT_FIELD => $this->solution->id()]);
     $items = [];
     foreach ($entities as $entity) {
         $items[] = ['#markup' => $entity->link()];
     }
     // Also retrieve related collections.
     $ids = $this->entityManager->getStorage('rdf_entity')->getQuery()->condition('field_ar_affiliates', $this->solution->id())->execute();
     $entities = Rdf::loadMultiple($ids);
     foreach ($entities as $entity) {
         $items[] = ['#markup' => $entity->link()];
     }
     // Build the array output.
     if ($items) {
         return ['list' => ['#theme' => 'item_list', '#items' => $items, '#cache' => ['tags' => ['entity:node:news', 'entity:rdf_entity:collection']]]];
     }
     return [];
 }
 /**
  * Returns a build array for the solution releases overview page.
  *
  * @param \Drupal\rdf_entity\RdfInterface $rdf_entity
  *   The solution rdf entity.
  *
  * @return array
  *   The build array for the page.
  */
 public function overview(RdfInterface $rdf_entity)
 {
     $view_builder = $this->entityTypeManager()->getViewBuilder('rdf_entity');
     $ids = $this->queryFactory->get('rdf_entity', 'AND')->condition('rid', 'asset_release')->condition('field_isr_is_version_of', $rdf_entity->id())->sort('field_isr_creation_date', 'DESC')->execute();
     $releases = [];
     /** @var \Drupal\rdf_entity\RdfInterface $release */
     foreach (Rdf::loadMultiple($ids) as $release) {
         $releases[] = $view_builder->view($release, 'compact');
     }
     return ['#theme' => 'asset_release_releases_download', '#releases' => $releases];
 }