LTI Integration Library 5.2.0
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
ceLTIc\LTI\Content\Image Class Reference

Class to represent a content-item image object. More...

Public Member Functions

 __construct (string $url, ?int $width=null, ?int $height=null)
 Class constructor.
 
object toJsonldObject ()
 Generate the JSON-LD object representation of the image.
 
object toJsonObject ()
 Generate the JSON object representation of the image.
 

Static Public Member Functions

static Image null fromJsonObject (object|string $item)
 Generate an Image object from its JSON or JSON-LD representation.
 

Detailed Description

Class to represent a content-item image object.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

ceLTIc\LTI\Content\Image::__construct ( string $url,
?int $width = null,
?int $height = null )

Class constructor.

Parameters
string$urlURL of image
int | null$widthWidth of image in pixels (optional)
int | null$heightHeight of image in pixels (optional)

Member Function Documentation

◆ fromJsonObject()

static Image null ceLTIc\LTI\Content\Image::fromJsonObject ( object|string $item)
static

Generate an Image object from its JSON or JSON-LD representation.

Parameters
object | string$itemA JSON or JSON-LD object representing an image or an image URL
Returns
Image|null The Image object

Referenced by ceLTIc\LTI\Content\Item\fromJsonObject(), and toJsonldObject().

◆ toJsonldObject()

object ceLTIc\LTI\Content\Image::toJsonldObject ( )

Generate the JSON-LD object representation of the image.

Returns
object JSON object

References ceLTIc\LTI\Util\checkInteger(), ceLTIc\LTI\Util\checkUrl(), and fromJsonObject().

◆ toJsonObject()

object ceLTIc\LTI\Content\Image::toJsonObject ( )

Generate the JSON object representation of the image.

Returns
object JSON object

References ceLTIc\LTI\Util\$strictMode.