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

Class to represent a line-item object. More...

Public Member Functions

 __construct (string $label, int|float $scoreMaximum, ?string $resourceId=null, ?string $tag=null, ?SubmissionReview $submissionReview=null)
 Class constructor.
 
object toJsonldObject ()
 Generate the JSON-LD object representation of the line-item.
 
object toJsonObject ()
 Generate the JSON object representation of the line-item.
 

Static Public Member Functions

static LineItem null fromJsonObject (object $item)
 Generate a LineItem object from its JSON or JSON-LD representation.
 

Detailed Description

Class to represent a line-item 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()

__construct ( string $label,
int|float $scoreMaximum,
?string $resourceId = null,
?string $tag = null,
?SubmissionReview $submissionReview = null )

Class constructor.

Parameters
string$labelLabel
int | float$scoreMaximumMaximum score
string | null$resourceIdResource ID (optional)
string | null$tagTag (optional)
SubmissionReview | null$submissionReviewSubmission Review (optional)

Member Function Documentation

◆ fromJsonObject()

static LineItem null fromJsonObject ( object $item)
static

Generate a LineItem object from its JSON or JSON-LD representation.

Parameters
object$itemA JSON or JSON-LD object representing a content-item
Returns
LineItem|null The LineItem object

References SubmissionReview\fromJsonObject().

◆ toJsonldObject()

object toJsonldObject ( )

Generate the JSON-LD object representation of the line-item.

Returns
object JSON object

◆ toJsonObject()

object toJsonObject ( )

Generate the JSON object representation of the line-item.

Returns
object JSON object