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

Public Member Functions

 delete (int $id)
 Delete a resource_link based on id.
 
 delete_by_deployment (int $deploymentid)
 Delete all resource links for a given deployment, as well as any mappings between users and the respective links.
 
 delete_by_resource (int $resourceid)
 Delete all resource_link instances referring to the resource identified by $resourceid.
 
 exists (int $id)
 Check whether or not the given resource_link object exists.
 
 find (int $id)
 Find and return a resource_link by id.
 
 find_by_deployment (deployment $deployment, string $resourcelinkid)
 Get a resource by id, within a given tool deployment.
 
 find_by_resource (int $resourceid)
 Gets all mapped resource links for a given resource.
 
 find_by_resource_and_user (int $resourceid, int $userid)
 Find resource_link objects based on the resource and a given launching user.
 
 save (resource_link $resourcelink)
 Save a resource link instance in the store.
 

Member Function Documentation

◆ delete()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::delete ( int $id)

Delete a resource_link based on id.

Parameters
int$idthe id of the resource_link to remove.

◆ delete_by_deployment()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::delete_by_deployment ( int $deploymentid)

Delete all resource links for a given deployment, as well as any mappings between users and the respective links.

Parameters
int$deploymentidthe id of the deployment instance.

◆ delete_by_resource()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::delete_by_resource ( int $resourceid)

Delete all resource_link instances referring to the resource identified by $resourceid.

Parameters
int$resourceidthe id of the published resource.

◆ exists()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::exists ( int $id)

Check whether or not the given resource_link object exists.

Parameters
int$idthe unique id the resource_link.
Return values
booltrue if found, false otherwise.

◆ find()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::find ( int $id)

Find and return a resource_link by id.

Parameters
int$idthe id of the resource_link object.
Return values
resource_link|nullthe resource_link object, or null if the object cannot be found.

◆ find_by_deployment()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::find_by_deployment ( deployment $deployment,
string $resourcelinkid )

Get a resource by id, within a given tool deployment.

Parameters
deployment$deploymentthe deployment instance.
string$resourcelinkidthe resourcelinkid from the platform.
Return values
resource_link|nullthe resource link instance, or null if not found.

◆ find_by_resource()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::find_by_resource ( int $resourceid)

Gets all mapped resource links for a given resource.

Parameters
int$resourceidthe local id of the shared resource.
Return values
arraythe array of resource_link instances.

◆ find_by_resource_and_user()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::find_by_resource_and_user ( int $resourceid,
int $userid )

Find resource_link objects based on the resource and a given launching user.

Parameters
int$resourceidthe local id of the resource (enrol_lti_tools id)
int$useridthe local id of the enrol_lti\local\ltiadvantage\user object
Return values
arrayan array of resource_links

◆ save()

enrol_lti\local\ltiadvantage\repository\resource_link_repository::save ( resource_link $resourcelink)

Save a resource link instance in the store.

Parameters
resource_link$resourcelinkthe object to save.
Return values
resource_linkthe saved object.

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