You are here

public function ImageWidgetCropManager::__construct in Image Widget Crop 8.2

Same name and namespace in other branches
  1. 8 src/ImageWidgetCropManager.php \Drupal\image_widget_crop\ImageWidgetCropManager::__construct()

Constructs a ImageWidgetCropManager object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity type manager service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/ImageWidgetCropManager.php, line 78

Class

ImageWidgetCropManager
ImageWidgetCropManager calculation class.

Namespace

Drupal\image_widget_crop

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory) {
  $this->entityTypeManager = $entity_type_manager;
  $this->cropStorage = $this->entityTypeManager
    ->getStorage('crop');
  $this->cropTypeStorage = $this->entityTypeManager
    ->getStorage('crop_type');
  $this->imageStyleStorage = $this->entityTypeManager
    ->getStorage('image_style');
  $this->fileStorage = $this->entityTypeManager
    ->getStorage('file');
  $this->imageWidgetCropSettings = $config_factory
    ->get('image_widget_crop.settings');
}