forked from zxbodya/yii2-gallery-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GalleryImage.php
40 lines (34 loc) · 938 Bytes
/
GalleryImage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace zxbodya\yii2\galleryManager;
class GalleryImage
{
public $name;
public $description;
public $id;
public $rank;
/**
* @var GalleryBehavior
*/
protected $galleryBehavior;
/**
* @param GalleryBehavior $galleryBehavior
* @param array $props
*/
function __construct(GalleryBehavior $galleryBehavior, array $props)
{
$this->galleryBehavior = $galleryBehavior;
$this->name = isset($props['name']) ? $props['name'] : '';
$this->description = isset($props['description']) ? $props['description'] : '';
$this->id = isset($props['id']) ? $props['id'] : '';
$this->rank = isset($props['rank']) ? $props['rank'] : '';
}
/**
* @param string $version
*
* @return string
*/
public function getUrl($version)
{
return $this->galleryBehavior->getUrl($this->id, $version);
}
}