LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
Placement Class Reference

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

Inheritance diagram for Placement:
ContentItemPlacement

Public Member Functions

 __construct ($documentTarget, $displayWidth=null, $displayHeight=null, $windowTarget=null, $windowFeatures=null, $url=null, $html=null)
 Class constructor.
 
 toJsonldObject ()
 Generate the JSON-LD object representation of the placement.
 
 toJsonObject ()
 Generate the JSON object representation of the placement.
 

Static Public Member Functions

static fromJsonObject ($item, $documentTarget=null)
 Generate the Placement object from an item.
 

Data Fields

const TYPE_EMBED = 'embed'
 Embed placement type.
 
const TYPE_IFRAME = 'iframe'
 iFrame placement type.
 
const TYPE_FRAME = 'frame'
 Frame placement type.
 
const TYPE_WINDOW = 'window'
 Window placement type.
 
const TYPE_POPUP = 'popup'
 Popup placement type.
 
const TYPE_OVERLAY = 'overlay'
 Overlay placement type.
 
 $documentTarget = null
 Location to open content in.
 

Detailed Description

Class to represent a content-item placement 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

Definition at line 12 of file Placement.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $documentTarget,
  $displayWidth = null,
  $displayHeight = null,
  $windowTarget = null,
  $windowFeatures = null,
  $url = null,
  $html = null 
)

Class constructor.

Parameters
string$documentTargetLocation to open content in
int | null$displayWidthWidth of item location (optional)
int | null$displayHeightHeight of item location (optional)
string | null$windowTargetName of window target (optional)
string | null$windowFeaturesList of window features (optional)
string | null$urlURL for iframe src (optional)
string | null$htmlHTML to be embedded (optional)

Definition at line 105 of file Placement.php.

References Placement\$documentTarget.

Member Function Documentation

◆ fromJsonObject()

static fromJsonObject (   $item,
  $documentTarget = null 
)
static

Generate the Placement object from an item.

Parameters
object$itemJSON object of item
string | null$documentTargetDestination of placement to be generated (optional)
Returns
Placement|null The Placement object

Definition at line 199 of file Placement.php.

◆ toJsonldObject()

toJsonldObject ( )

Generate the JSON-LD object representation of the placement.

Returns
object|null JSON object

Definition at line 122 of file Placement.php.

References Placement\$documentTarget.

◆ toJsonObject()

toJsonObject ( )

Generate the JSON object representation of the placement.

Returns
object|null JSON object

Definition at line 148 of file Placement.php.

References Placement\TYPE_EMBED, Placement\TYPE_IFRAME, and Placement\TYPE_WINDOW.

Field Documentation

◆ $documentTarget

string null $documentTarget = null

Location to open content in.

Definition at line 50 of file Placement.php.

Referenced by ContentItemPlacement\__construct(), Placement\__construct(), and Placement\toJsonldObject().

◆ TYPE_EMBED

const TYPE_EMBED = 'embed'

Embed placement type.

Definition at line 18 of file Placement.php.

Referenced by Placement\toJsonObject().

◆ TYPE_FRAME

const TYPE_FRAME = 'frame'

Frame placement type.

Definition at line 28 of file Placement.php.

◆ TYPE_IFRAME

const TYPE_IFRAME = 'iframe'

iFrame placement type.

Definition at line 23 of file Placement.php.

Referenced by Placement\toJsonObject().

◆ TYPE_OVERLAY

const TYPE_OVERLAY = 'overlay'

Overlay placement type.

Definition at line 43 of file Placement.php.

◆ TYPE_POPUP

const TYPE_POPUP = 'popup'

Popup placement type.

Definition at line 38 of file Placement.php.

◆ TYPE_WINDOW

const TYPE_WINDOW = 'window'

Window placement type.

Definition at line 33 of file Placement.php.

Referenced by Placement\toJsonObject().


The documentation for this class was generated from the following file: