12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\forks\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);
- }
- }
|