Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
enrol_lti\local\ltiadvantage\entity\context Class Reference

Public Member Functions

 get_contextid ()
 Return the platform contextid string.
 
 get_deploymentid ()
 Get the id of the local deployment instance to which this context instance belongs.
 
 get_id ()
 Get the object instance id.
 
 get_types ()
 Get the context types this context instance represents.
 
 set_types (array $types)
 Set the list of types this context instance represents.
 

Static Public Member Functions

static create (int $deploymentid, string $contextid, array $types, ?int $id=null)
 Factory method for creating a context instance.
 

Member Function Documentation

◆ create()

static enrol_lti\local\ltiadvantage\entity\context::create ( int $deploymentid,
string $contextid,
array $types,
?int $id = null )
static

Factory method for creating a context instance.

Parameters
int$deploymentidthe local id of the deployment instance to which this context belongs.
string$contextidthe context id string, as provided by the platform during launch.
array$typesan array of string context types, as provided by the platform during launch.
int | null$idlocal id of this object instance, nullable for new objects.
Return values
contextthe context instance.

◆ get_contextid()

enrol_lti\local\ltiadvantage\entity\context::get_contextid ( )

Return the platform contextid string.

Return values
stringthe id of the context in the platform.

◆ get_deploymentid()

enrol_lti\local\ltiadvantage\entity\context::get_deploymentid ( )

Get the id of the local deployment instance to which this context instance belongs.

Return values
intthe id of the local deployment instance to which this context instance belongs.

◆ get_id()

enrol_lti\local\ltiadvantage\entity\context::get_id ( )

Get the object instance id.

Return values
int|nullthe id, or null if the object doesn't yet have one assigned.

◆ get_types()

enrol_lti\local\ltiadvantage\entity\context::get_types ( )

Get the context types this context instance represents.

Return values
string[]the array of context types this context instance represents.

◆ set_types()

enrol_lti\local\ltiadvantage\entity\context::set_types ( array $types)

Set the list of types this context instance represents.

Parameters
array$typesthe array of string types.
Exceptions
coding_exceptionif any of the supplied types are invalid.

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