You are here

public function ViewmodepagePatternRepository::findAll in View Mode Page 3.2.x

Same name and namespace in other branches
  1. 8.3 src/Repository/ViewmodepagePatternRepository.php \Drupal\view_mode_page\Repository\ViewmodepagePatternRepository::findAll()
  2. 4.0.x src/Repository/ViewmodepagePatternRepository.php \Drupal\view_mode_page\Repository\ViewmodepagePatternRepository::findAll()

Find all patterns.

Return value

\Drupal\view_mode_page\ViewmodepagePatternInterface[] The viewmodepage pattern interface.

File

src/Repository/ViewmodepagePatternRepository.php, line 36

Class

ViewmodepagePatternRepository
Class ViewmodepagePatternRepository.

Namespace

Drupal\view_mode_page\Repository

Code

public function findAll() {
  static $patterns;
  if (!isset($patterns)) {
    $ids = $this->entityTypeManager
      ->getStorage('view_mode_page_pattern')
      ->getQuery()
      ->sort('weight')
      ->execute();
    $patterns = $this->entityTypeManager
      ->getStorage('view_mode_page_pattern')
      ->loadMultiple($ids);
  }
  return $patterns;
}