Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ImageFactory.php
1<?php
2
4
6
16{
17 public const MORE_PHOTO_IMAGE = MorePhotoImage::class;
18 public const DETAIL_IMAGE = DetailImage::class;
19 public const PREVIEW_IMAGE = PreviewImage::class;
20 public const IMAGE_COLLECTION = ImageCollection::class;
21
22 protected $container;
23
30 {
31 $this->container = $container;
32 }
33
38 public function createEntity(string $type = null): BaseImage
39 {
40 switch ($type)
41 {
43 return $this->container->make(self::PREVIEW_IMAGE);
44
46 return $this->container->make(self::DETAIL_IMAGE);
47 }
48
49 return $this->container->make(self::MORE_PHOTO_IMAGE);
50 }
51
56 {
57 return $this->container->make(self::IMAGE_COLLECTION);
58 }
59}
__construct(ContainerContract $container)