ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
LightboxImagePage.php
Go to the documentation of this file.
1<?php
2
4
8
18{
20
24 protected $image;
28 protected $title;
32 protected $description;
33
34
40 public function __construct(Image $image, $title, $description = '')
41 {
42 $this->checkArgInstanceOf('image', $image, Image::class);
43 $this->checkStringArg('title', $title);
44 $this->checkStringArg('description', $description);
45 $this->image = $image;
46 $this->title = $title;
47 $this->description = $description;
48 }
49
50
54 public function getTitle()
55 {
56 return $this->title;
57 }
58
59
63 public function getDescription() : string
64 {
65 return $this->description ? $this->description : $this->image->getAlt();
66 }
67
68
72 public function getComponent()
73 {
74 return $this->image;
75 }
76}
An exception for terminatinating execution or to throw for unit testing.
getTitle()
Get the title of this page, displayed as title in the lightbox modal.string
__construct(Image $image, $title, $description='')
getDescription()
Get the description of this page, displayed along with the media item.string
getComponent()
Get the component representing the media item to be displayed in the modals content section,...
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
trait ComponentHelper
Provides common functionality for component implementations.
checkArgInstanceOf($which, $value, $class)
Throw an InvalidArgumentException if $value is not an instance of $class.