You are here

private function SplashifyInjection::getSplashes in Splashify 8.2

Received all of splashes that can be displayed on the current page.

Return value

array Array of SplashifyEntity.

1 call to SplashifyInjection::getSplashes()
SplashifyInjection::findSplash in src/Service/SplashifyInjection.php
Choosing an entity which will be displayed.

File

src/Service/SplashifyInjection.php, line 82

Class

SplashifyInjection
Class SplashifyInjection.

Namespace

Drupal\splashify\Service

Code

private function getSplashes() {
  $page_groups = $this
    ->getPageGroups();
  $page_groups_id = array_keys($page_groups);
  if (empty($page_groups_id)) {
    return [];
  }
  $splashes_id = \Drupal::entityQuery('splashify_entity')
    ->condition('status', 1)
    ->sort('field_weight', 'DESC')
    ->sort('id', 'DESC')
    ->condition('field_group', $page_groups_id, 'IN')
    ->execute();
  if (empty($splashes_id)) {
    return [];
  }
  $splashes = SplashifyEntity::loadMultiple($splashes_id);
  return $splashes;
}