Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
PreviewImageOptions.php
1
<?php
2
3
namespace
Bitrix\UI\FileUploader
;
4
5
use
Bitrix\Main\File\Image
;
6
7
class
PreviewImageOptions
8
{
9
protected
int
$width
= 300;
10
protected
int
$height
= 300;
11
protected
int
$mode
=
Image::RESIZE_PROPORTIONAL
;
12
13
public
function
__construct
(array $options = [])
14
{
15
$optionNames = [
16
'width'
,
17
'height'
,
18
'mode'
,
19
];
20
21
foreach
($optionNames as $optionName)
22
{
23
if
(array_key_exists($optionName, $options))
24
{
25
$optionValue = $options[$optionName];
26
$setter =
'set'
. ucfirst($optionName);
27
$this->$setter($optionValue);
28
}
29
}
30
}
31
32
public
function
getWidth
(): int
33
{
34
return
$this->width
;
35
}
36
37
public
function
setWidth
(
int
$width
): self
38
{
39
$this->width =
$width
;
40
41
return
$this;
42
}
43
44
public
function
getHeight
(): int
45
{
46
return
$this->height
;
47
}
48
49
public
function
setHeight
(
int
$height
): self
50
{
51
$this->height =
$height
;
52
53
return
$this;
54
}
55
56
public
function
getMode
(): int
57
{
58
return
$this->mode
;
59
}
60
61
public
function
setMode
(
int
$mode
): self
62
{
63
$this->mode =
$mode
;
64
65
return
$this;
66
}
67
}
Bitrix\Main\File\Image\RESIZE_PROPORTIONAL
const RESIZE_PROPORTIONAL
Definition
Image.php:24
Bitrix\UI\FileUploader\PreviewImageOptions
Definition
PreviewImageOptions.php:8
Bitrix\UI\FileUploader\PreviewImageOptions\setWidth
setWidth(int $width)
Definition
PreviewImageOptions.php:37
Bitrix\UI\FileUploader\PreviewImageOptions\$width
int $width
Definition
PreviewImageOptions.php:9
Bitrix\UI\FileUploader\PreviewImageOptions\__construct
__construct(array $options=[])
Definition
PreviewImageOptions.php:13
Bitrix\UI\FileUploader\PreviewImageOptions\getMode
getMode()
Definition
PreviewImageOptions.php:56
Bitrix\UI\FileUploader\PreviewImageOptions\$height
int $height
Definition
PreviewImageOptions.php:10
Bitrix\UI\FileUploader\PreviewImageOptions\setHeight
setHeight(int $height)
Definition
PreviewImageOptions.php:49
Bitrix\UI\FileUploader\PreviewImageOptions\$mode
int $mode
Definition
PreviewImageOptions.php:11
Bitrix\UI\FileUploader\PreviewImageOptions\getHeight
getHeight()
Definition
PreviewImageOptions.php:44
Bitrix\UI\FileUploader\PreviewImageOptions\setMode
setMode(int $mode)
Definition
PreviewImageOptions.php:61
Bitrix\UI\FileUploader\PreviewImageOptions\getWidth
getWidth()
Definition
PreviewImageOptions.php:32
Bitrix\Main\File\Image
Definition
Color.php:9
Bitrix\UI\FileUploader
Definition
CanUploadResult.php:3
modules
ui
lib
FileUploader
PreviewImageOptions.php
Создано системой
1.10.0