Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ImageFactory.php
1
<?php
2
3
namespace
Bitrix\Catalog\v2\Image
;
4
5
use
Bitrix\Catalog\v2\IoC\ContainerContract
;
6
15
class
ImageFactory
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
29
public
function
__construct
(
ContainerContract
$container
)
30
{
31
$this->container =
$container
;
32
}
33
38
public
function
createEntity
(
string
$type =
null
):
BaseImage
39
{
40
switch
($type)
41
{
42
case
self::PREVIEW_IMAGE
:
43
return
$this->container->make(self::PREVIEW_IMAGE);
44
45
case
self::DETAIL_IMAGE
:
46
return
$this->container->make(self::DETAIL_IMAGE);
47
}
48
49
return
$this->container->make(self::MORE_PHOTO_IMAGE);
50
}
51
55
public
function
createCollection
():
ImageCollection
56
{
57
return
$this->container->make(self::IMAGE_COLLECTION);
58
}
59
}
Bitrix\Catalog\v2\Image\BaseImage
Definition
BaseImage.php:17
Bitrix\Catalog\v2\Image\ImageCollection
Definition
ImageCollection.php:17
Bitrix\Catalog\v2\Image\ImageFactory
Definition
ImageFactory.php:16
Bitrix\Catalog\v2\Image\ImageFactory\PREVIEW_IMAGE
const PREVIEW_IMAGE
Definition
ImageFactory.php:19
Bitrix\Catalog\v2\Image\ImageFactory\__construct
__construct(ContainerContract $container)
Definition
ImageFactory.php:29
Bitrix\Catalog\v2\Image\ImageFactory\IMAGE_COLLECTION
const IMAGE_COLLECTION
Definition
ImageFactory.php:20
Bitrix\Catalog\v2\Image\ImageFactory\$container
$container
Definition
ImageFactory.php:22
Bitrix\Catalog\v2\Image\ImageFactory\DETAIL_IMAGE
const DETAIL_IMAGE
Definition
ImageFactory.php:18
Bitrix\Catalog\v2\Image\ImageFactory\MORE_PHOTO_IMAGE
const MORE_PHOTO_IMAGE
Definition
ImageFactory.php:17
Bitrix\Catalog\v2\Image\ImageFactory\createCollection
createCollection()
Definition
ImageFactory.php:55
Bitrix\Catalog\v2\Image\ImageFactory\createEntity
createEntity(string $type=null)
Definition
ImageFactory.php:38
Bitrix\Catalog\v2\IoC\ContainerContract
Definition
ContainerContract.php:15
Bitrix\Catalog\v2\Image
Definition
BaseImage.php:3
modules
catalog
lib
v2
Image
ImageFactory.php
Создано системой
1.10.0