You are here

public function BackgroundImageManager::__construct in Background Image 8

Same name and namespace in other branches
  1. 2.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::__construct()
  2. 2.0.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::__construct()

BackgroundImageManager constructor.

@noinspection PhpDocMissingThrowsInspection

Parameters

\Drupal\Core\Config\ConfigFactoryInterface: The Config Factory service.

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The Entity Type Bundle Info service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The Entity Type manager service.

\Drupal\Core\File\FileSystemInterface $file_system: The File System service.

\Drupal\Core\Image\ImageFactory $image_factory: The Image Factory service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The Module Handler service.

\Drupal\Core\Routing\ResettableStackedRouteMatchInterface $route_match: The Route Match service.

\Drupal\Core\State\StateInterface $state: The State service.

\Drupal\Core\Routing\UrlGeneratorInterface $url_generator: The UrlGenerator service.

File

src/BackgroundImageManager.php, line 137

Class

BackgroundImageManager

Namespace

Drupal\background_image

Code

public function __construct(ConfigFactoryInterface $config_factory, EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, FileSystemInterface $file_system, ImageFactory $image_factory, ModuleHandlerInterface $module_handler, ResettableStackedRouteMatchInterface $route_match, StateInterface $state, UrlGeneratorInterface $url_generator) {
  $this->config = $config_factory
    ->get('background_image.settings');
  $this->entityRepository = $entity_repository;
  $this->entityTypeBundleInfo = $entity_type_bundle_info;
  $this->entityTypeManager = $entity_type_manager;
  $this->fileSystem = $file_system;
  $this->imageFactory = $image_factory;
  $this->moduleHandler = $module_handler;
  $this->routeMatch = $route_match;
  $this->state = $state;
  $this->urlGenerator = $url_generator;

  /** @noinspection PhpUnhandledExceptionInspection */
  $this->storage = $this->entityTypeManager
    ->getStorage('background_image');
  $this->viewBuilder = $this->entityTypeManager
    ->getViewBuilder('background_image');
}