You are here

class ViewmodepagePatternRepository in View Mode Page 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Repository/ViewmodepagePatternRepository.php \Drupal\view_mode_page\Repository\ViewmodepagePatternRepository
  2. 3.2.x src/Repository/ViewmodepagePatternRepository.php \Drupal\view_mode_page\Repository\ViewmodepagePatternRepository

Class ViewmodepagePatternRepository.

@package Drupal\view_mode_page\Repository

Hierarchy

Expanded class hierarchy of ViewmodepagePatternRepository

1 file declares its use of ViewmodepagePatternRepository
DynamicPathProcessor.php in src/PathProcessor/DynamicPathProcessor.php
1 string reference to 'ViewmodepagePatternRepository'
view_mode_page.services.yml in ./view_mode_page.services.yml
view_mode_page.services.yml
1 service uses ViewmodepagePatternRepository
view_mode_page.repository.pattern in ./view_mode_page.services.yml
Drupal\view_mode_page\Repository\ViewmodepagePatternRepository

File

src/Repository/ViewmodepagePatternRepository.php, line 12

Namespace

Drupal\view_mode_page\Repository
View source
class ViewmodepagePatternRepository {

  /**
   * The entity type manager interface.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * ViewmodepagePatternRepository constructor.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager interface.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
  }

  /**
   * Find all patterns.
   *
   * @return \Drupal\view_mode_page\ViewmodepagePatternInterface[]
   *   The viewmodepage pattern interface.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ViewmodepagePatternRepository::$entityTypeManager protected property The entity type manager interface.
ViewmodepagePatternRepository::findAll public function Find all patterns.
ViewmodepagePatternRepository::__construct public function ViewmodepagePatternRepository constructor.