1 | <?php |
||
8 | class ImageModel extends ViewModel |
||
9 | { |
||
10 | /** |
||
11 | * Image won't need to be captured into a |
||
12 | * a parent container by default. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $captureTo = null; |
||
17 | |||
18 | /** |
||
19 | * Image is terminal |
||
20 | * |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $terminate = true; |
||
24 | |||
25 | /** |
||
26 | * Path of image to show |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $imagePath; |
||
31 | |||
32 | /** |
||
33 | * @var ImageInterface |
||
34 | */ |
||
35 | protected $image; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $format = 'png'; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $imageOutputOptions = []; |
||
46 | |||
47 | /** |
||
48 | * Constructor |
||
49 | * |
||
50 | * @param ImageInterface|string $imageOrPath |
||
51 | * @param string|null $format |
||
52 | * @param array $imageOutputOptions |
||
53 | * @throws Exception\InvalidArgumentException |
||
54 | */ |
||
55 | 6 | public function __construct($imageOrPath = null, $format = null, array $imageOutputOptions = []) |
|
77 | |||
78 | /** |
||
79 | * Sets path of image to show |
||
80 | * |
||
81 | * @param string $imagePath |
||
82 | * @return self |
||
83 | */ |
||
84 | 1 | public function setImagePath($imagePath) |
|
91 | |||
92 | /** |
||
93 | * Gets path of image to show |
||
94 | * |
||
95 | * @return string $fileName |
||
96 | */ |
||
97 | 2 | public function getImagePath() |
|
101 | |||
102 | /** |
||
103 | * Sets image |
||
104 | * |
||
105 | * @param ImageInterface $image |
||
106 | * @return self |
||
107 | */ |
||
108 | 3 | public function setImage(ImageInterface $image) |
|
114 | |||
115 | /** |
||
116 | * Gets image |
||
117 | * |
||
118 | * @return ImageInterface |
||
119 | */ |
||
120 | 4 | public function getImage() |
|
124 | |||
125 | /** |
||
126 | * Sets format |
||
127 | * |
||
128 | * @param string $format |
||
129 | * @return self |
||
130 | */ |
||
131 | 3 | public function setFormat($format) |
|
137 | |||
138 | /** |
||
139 | * Gets format |
||
140 | * |
||
141 | * @return string |
||
142 | */ |
||
143 | 3 | public function getFormat() |
|
147 | |||
148 | /** |
||
149 | * Sets imageOutputOptions |
||
150 | * |
||
151 | * @param array $imageOutputOptions |
||
152 | * @return self |
||
153 | */ |
||
154 | 5 | public function setImageOutputOptions(array $imageOutputOptions) |
|
160 | |||
161 | /** |
||
162 | * Gets imageOutputOptions |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | 2 | public function getImageOutputOptions() |
|
170 | } |
||
171 |