Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
enrol_lti\local\ltiadvantage\entity\resource_link Class Reference

Public Member Functions

 add_grade_service (?\moodle_url $lineitemsurl=null, ?\moodle_url $lineitemurl=null, array $scopes=[])
 Add grade service information to this resource_link instance.
 
 add_names_and_roles_service (\moodle_url $contextmembershipurl, array $serviceversions)
 Add names and roles service information to this resource_link instance.
 
 add_user (int $userid, string $sourceid, string $lang, string $city, string $country, string $institution, string $timezone, ?int $maildisplay=null)
 Factory method to create a user from this resource_link instance.
 
 get_contextid ()
 Return the id of the context object holding information about where this resource link resides.
 
 get_deploymentid ()
 Return the id of the deployment to which this resource link belongs.
 
 get_grade_service ()
 Get the grade service attached to this resource_link instance, or null if there isn't one associated.
 
 get_id ()
 Return the id of this object instance.
 
 get_names_and_roles_service ()
 Get the names and roles service attached to this resource_link instance, or null if there isn't one associated.
 
 get_resourceid ()
 Get the local id of the published resource to which this resource link refers.
 
 get_resourcelinkid ()
 Get the resourcelinkid as provided by the platform.
 
 set_contextid (int $contextid)
 Link this resource_link instance with a context.
 
 set_resourceid (int $resourceid)
 Set which local published resource this resource link refers to.
 

Static Public Member Functions

static create (string $resourcelinkid, int $deploymentid, int $resourceid, ?int $contextid=null, int $id=null)
 Factory method to create an instance.
 

Member Function Documentation

◆ add_grade_service()

enrol_lti\local\ltiadvantage\entity\resource_link::add_grade_service ( ?\moodle_url $lineitemsurl = null,
?\moodle_url $lineitemurl = null,
array $scopes = [] )

Add grade service information to this resource_link instance.

Parameters
moodle_url | null$lineitemsurlthe service URL for get/put of line items, if supported.
moodle_url | null$lineitemurlthe service URL if only a single line item is present in the platform.
string[]$scopesthe string array of grade service scopes which may be used by the service.

◆ add_names_and_roles_service()

enrol_lti\local\ltiadvantage\entity\resource_link::add_names_and_roles_service ( \moodle_url $contextmembershipurl,
array $serviceversions )

Add names and roles service information to this resource_link instance.

Parameters
moodle_url$contextmembershipurlthe service URL for memberships.
string[]$serviceversionsthe string array of supported service versions.

◆ add_user()

enrol_lti\local\ltiadvantage\entity\resource_link::add_user ( int $userid,
string $sourceid,
string $lang,
string $city,
string $country,
string $institution,
string $timezone,
?int $maildisplay = null )

Factory method to create a user from this resource_link instance.

This is useful for associating the user with the resource link and resource I.e. the user was created when launching a specific resource link.

Parameters
int$useridthe id of the Moodle user record.
string$sourceidthe id of the user on the platform.
string$langthe user's lang code.
string$citythe user's city.
string$countrythe user's country.
string$institutionthe user's institution.
string$timezonethe user's timezone.
int | null$maildisplaythe user's maildisplay, which can be omitted to use sensible defaults.
Return values
userthe user instance.
Exceptions
coding_exceptionif trying to add a user to an as-yet-unsaved resource_link instance.

◆ create()

static enrol_lti\local\ltiadvantage\entity\resource_link::create ( string $resourcelinkid,
int $deploymentid,
int $resourceid,
?int $contextid = null,
int $id = null )
static

Factory method to create an instance.

Parameters
string$resourcelinkidthe resourcelinkid, as provided by the platform.
int$deploymentidthe local id of the deployment to which this resource link belongs.
int$resourceidthe id of the local resource this resource_link refers to.
int | null$contextidthe id of the local context object representing the platform context.
int | null$idthe local id of the resource link instance.
Return values
resource_linkthe newly created instance.

◆ get_contextid()

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

Return the id of the context object holding information about where this resource link resides.

Return values
int|nullthe id or null if not present.

◆ get_deploymentid()

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

Return the id of the deployment to which this resource link belongs.

This id is the local id of the deployment instance, not the deploymentid provided by the platform.

Return values
intthe deployment id.

◆ get_grade_service()

enrol_lti\local\ltiadvantage\entity\resource_link::get_grade_service ( )

Get the grade service attached to this resource_link instance, or null if there isn't one associated.

Return values
ags_info|nullthe grade service object instance, or null if not found.

◆ get_id()

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

Return the id of this object instance.

Return values
null|intthe id or null if the object has not yet been stored.

◆ get_names_and_roles_service()

enrol_lti\local\ltiadvantage\entity\resource_link::get_names_and_roles_service ( )

Get the names and roles service attached to this resource_link instance, or null if there isn't one associated.

Return values
nrps_info|nullthe names and roles service object instance, or null if not found.

◆ get_resourceid()

enrol_lti\local\ltiadvantage\entity\resource_link::get_resourceid ( )

Get the local id of the published resource to which this resource link refers.

Return values
intthe id of the published resource.

◆ get_resourcelinkid()

enrol_lti\local\ltiadvantage\entity\resource_link::get_resourcelinkid ( )

Get the resourcelinkid as provided by the platform.

Return values
stringthe resourcelinkid.

◆ set_contextid()

enrol_lti\local\ltiadvantage\entity\resource_link::set_contextid ( int $contextid)

Link this resource_link instance with a context.

Parameters
int$contextidthe local id of the context instance containing information about the platform context.

◆ set_resourceid()

enrol_lti\local\ltiadvantage\entity\resource_link::set_resourceid ( int $resourceid)

Set which local published resource this resource link refers to.

Parameters
int$resourceidthe published resource id.

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