function MediaListBuilder::__construct

Same name in other branches
  1. 8.9.x core/modules/media/src/MediaListBuilder.php \Drupal\media\MediaListBuilder::__construct()
  2. 10 core/modules/media/src/MediaListBuilder.php \Drupal\media\MediaListBuilder::__construct()
  3. 11.x core/modules/media/src/MediaListBuilder.php \Drupal\media\MediaListBuilder::__construct()

Constructs a new MediaListBuilder object.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage class.

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date formatter service.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager service.

\Drupal\Core\Entity\EntityStorageInterface $image_style_storage: The entity storage class for image styles.

Overrides EntityListBuilder::__construct

File

core/modules/media/src/MediaListBuilder.php, line 53

Class

MediaListBuilder
Provides a listing of media items.

Namespace

Drupal\media

Code

public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, DateFormatterInterface $date_formatter, LanguageManagerInterface $language_manager, EntityStorageInterface $image_style_storage) {
    parent::__construct($entity_type, $storage);
    $this->dateFormatter = $date_formatter;
    $this->languageManager = $language_manager;
    $this->thumbnailStyleExists = !empty($image_style_storage->load('thumbnail'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.