35 private ?
string $url =
null;
71 $image = new \stdClass();
73 if (!is_null($this->width)) {
76 if (!is_null($this->height)) {
90 $image = new \stdClass();
92 if (!is_null($this->width)) {
93 $image->width = $this->width;
95 if (!is_null($this->height)) {
96 $image->height = $this->height;
112 if (is_object($item)) {
114 foreach (get_object_vars($item) as
$name => $value) {
121 $width = $item->width;
124 $height = $item->height;
132 $obj =
new Image(
$url, $height, $width);
Class to represent a content-item image object.
__construct(string $url, int $width=null, int $height=null)
Class constructor.
toJsonldObject()
Generate the JSON-LD object representation of the image.
int $width
Width of image.
toJsonObject()
Generate the JSON object representation of the image.
static fromJsonObject(object $item)
Generate an Image object from its JSON or JSON-LD representation.
int $height
Height of image.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...