Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
PreviewImageOptions.php
1<?php
2
4
6
8{
9 protected int $width = 300;
10 protected int $height = 300;
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}
const RESIZE_PROPORTIONAL
Definition Image.php:24