| 1 | <?php |
||
| 15 | class Image |
||
| 16 | { |
||
| 17 | protected $imagePath; |
||
| 18 | public $file; |
||
| 19 | public $type; |
||
| 20 | public $size; |
||
| 21 | public $set; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Image constructor. |
||
| 25 | * @param \stdClass $image |
||
| 26 | * @param string $imagePath |
||
| 27 | */ |
||
| 28 | public function __construct(\stdClass $image, $imagePath = 'images') |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $imageVariant |
||
| 39 | * @return string |
||
| 40 | * @throws \Exception |
||
| 41 | */ |
||
| 42 | public function get($imageVariant = 'original') |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | public function __toString() |
||
| 57 | } |