Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
enrol_lti\data_connector Class Reference

Extends the IMS Tool provider library data connector for moodle. More...

Inheritance diagram for enrol_lti\data_connector:

Public Member Functions

 __construct ()
 data_connector constructor.
 
 deleteContext ($context)
 Delete context object. More...
 
 deleteResourceLink ($resourcelink)
 Delete resource link object. More...
 
 deleteResourceLinkShareKey ($sharekey)
 Delete resource link share key object. More...
 
 deleteToolConsumer ($consumer)
 Delete tool consumer object and related records. More...
 
 deleteToolProxy ($toolproxy)
 Delete the tool proxy from the database. More...
 
 deleteUser ($user)
 Delete user object. More...
 
 get_consumers_mapped_to_tool ($toolid)
 Fetches the list of ToolConsumer objects that are linked to a tool. More...
 
 get_contexts_from_consumer (ToolConsumer $consumer)
 Fetches the list of Context objects that are linked to a ToolConsumer. More...
 
 get_resourcelink_from_consumer (ToolConsumer $consumer)
 Fetches a resource link record that is associated with a ToolConsumer. More...
 
 get_resourcelink_from_context (Context $context)
 Fetches a resource link record that is associated with a Context object. More...
 
 getSharesResourceLink ($resourcelink)
 Get array of shares defined for this resource link. More...
 
 getToolConsumers ()
 Load all tool consumers from the database. More...
 
 getUserResultSourcedIDsResourceLink ($resourcelink, $localonly, $idscope)
 Get array of user objects. More...
 
 loadConsumerNonce ($nonce)
 Load nonce object. More...
 
 loadContext ($context)
 Load context object. More...
 
 loadResourceLink ($resourcelink)
 Load resource link object. More...
 
 loadResourceLinkShareKey ($sharekey)
 Load resource link share key object. More...
 
 loadToolConsumer ($consumer)
 Load tool consumer object. More...
 
 loadToolProxy ($toolproxy)
 Load the tool proxy from the database. More...
 
 loadUser ($user)
 Load user object. More...
 
 saveConsumerNonce ($nonce)
 Save nonce object. More...
 
 saveContext ($context)
 Save context object. More...
 
 saveResourceLink ($resourcelink)
 Save resource link object. More...
 
 saveResourceLinkShareKey ($sharekey)
 Save resource link share key object. More...
 
 saveToolConsumer ($consumer)
 Save tool consumer object. More...
 
 saveToolProxy ($toolproxy)
 Save the tool proxy to the database. More...
 
 saveUser ($user)
 Save user object. More...
 

Protected Member Functions

 build_tool_consumer_object ($record, ToolConsumer $consumer)
 Builds a ToolConsumer object from a record object from the DB. More...
 

Protected Attributes

string $consumertable
 Tool consumer table name.
 
string $contexttable
 Context table name.
 
string $noncetable
 Consumer nonce table name.
 
string $resourcelinktable
 Resource link table name.
 
string $sharekeytable
 Resource link share key table name.
 
string $toolproxytable
 Tool proxy table name.
 
string $userresulttable
 User result table name.
 

Detailed Description

Extends the IMS Tool provider library data connector for moodle.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ build_tool_consumer_object()

enrol_lti\data_connector::build_tool_consumer_object (   $record,
ToolConsumer  $consumer 
)
protected

Builds a ToolConsumer object from a record object from the DB.

Parameters
stdClass$recordThe DB record object.
ToolConsumer$consumer

◆ deleteContext()

enrol_lti\data_connector::deleteContext (   $context)

Delete context object.

Parameters
Context$contextContext object
Return values
booleanTrue if the Context object was successfully deleted

◆ deleteResourceLink()

enrol_lti\data_connector::deleteResourceLink (   $resourcelink)

Delete resource link object.

Parameters
ResourceLink$resourcelinkResourceLink object
Return values
booleanTrue if the resource link object and its related records were successfully deleted. Otherwise, a DML exception is thrown.

◆ deleteResourceLinkShareKey()

enrol_lti\data_connector::deleteResourceLinkShareKey (   $sharekey)

Delete resource link share key object.

Parameters
ResourceLinkShareKey$sharekeyResource link share key object
Return values
booleanTrue if the resource link share key object was successfully deleted

◆ deleteToolConsumer()

enrol_lti\data_connector::deleteToolConsumer (   $consumer)

Delete tool consumer object and related records.

Parameters
ToolConsumer$consumerConsumer object
Return values
booleanTrue if the tool consumer object was successfully deleted

◆ deleteToolProxy()

enrol_lti\data_connector::deleteToolProxy (   $toolproxy)

Delete the tool proxy from the database.

Parameters
ToolProxy$toolproxy
Return values
bool

◆ deleteUser()

enrol_lti\data_connector::deleteUser (   $user)

Delete user object.

Parameters
User$userUser object
Return values
booleanTrue if the user object was successfully deleted

◆ get_consumers_mapped_to_tool()

enrol_lti\data_connector::get_consumers_mapped_to_tool (   $toolid)

Fetches the list of ToolConsumer objects that are linked to a tool.

Parameters
int$toolid
Return values
ToolConsumer[]

◆ get_contexts_from_consumer()

enrol_lti\data_connector::get_contexts_from_consumer ( ToolConsumer  $consumer)

Fetches the list of Context objects that are linked to a ToolConsumer.

Parameters
ToolConsumer$consumer
Return values
Context[]

◆ get_resourcelink_from_consumer()

enrol_lti\data_connector::get_resourcelink_from_consumer ( ToolConsumer  $consumer)

Fetches a resource link record that is associated with a ToolConsumer.

Parameters
ToolConsumer$consumer
Return values
ResourceLink

◆ get_resourcelink_from_context()

enrol_lti\data_connector::get_resourcelink_from_context ( Context  $context)

Fetches a resource link record that is associated with a Context object.

Parameters
Context$context
Return values
ResourceLink

◆ getSharesResourceLink()

enrol_lti\data_connector::getSharesResourceLink (   $resourcelink)

Get array of shares defined for this resource link.

Parameters
ResourceLink$resourcelinkResourceLink object
Return values
arrayArray of ResourceLinkShare objects

◆ getToolConsumers()

enrol_lti\data_connector::getToolConsumers ( )

Load all tool consumers from the database.

Return values
array

◆ getUserResultSourcedIDsResourceLink()

enrol_lti\data_connector::getUserResultSourcedIDsResourceLink (   $resourcelink,
  $localonly,
  $idscope 
)

Get array of user objects.

Obtain an array of User objects for users with a result sourcedId. The array may include users from other resource links which are sharing this resource link. It may also be optionally indexed by the user ID of a specified scope.

Parameters
ResourceLink$resourcelinkResource link object
boolean$localonlyTrue if only users within the resource link are to be returned (excluding users sharing this resource link)
int$idscopeScope value to use for user IDs
Return values
arrayArray of User objects

◆ loadConsumerNonce()

enrol_lti\data_connector::loadConsumerNonce (   $nonce)

Load nonce object.

Parameters
ConsumerNonce$nonceNonce object
Return values
booleanTrue if the nonce object was successfully loaded

◆ loadContext()

enrol_lti\data_connector::loadContext (   $context)

Load context object.

Parameters
Context$contextContext object
Return values
booleanTrue if the context object was successfully loaded

◆ loadResourceLink()

enrol_lti\data_connector::loadResourceLink (   $resourcelink)

Load resource link object.

Parameters
ResourceLink$resourcelinkResourceLink object
Return values
booleanTrue if the resource link object was successfully loaded

◆ loadResourceLinkShareKey()

enrol_lti\data_connector::loadResourceLinkShareKey (   $sharekey)

Load resource link share key object.

Parameters
ResourceLinkShareKey$sharekeyResourceLink share key object
Return values
booleanTrue if the resource link share key object was successfully loaded

◆ loadToolConsumer()

enrol_lti\data_connector::loadToolConsumer (   $consumer)

Load tool consumer object.

Parameters
ToolConsumer$consumerToolConsumer object
Return values
booleanTrue if the tool consumer object was successfully loaded

◆ loadToolProxy()

enrol_lti\data_connector::loadToolProxy (   $toolproxy)

Load the tool proxy from the database.

Parameters
ToolProxy$toolproxy
Return values
bool

◆ loadUser()

enrol_lti\data_connector::loadUser (   $user)

Load user object.

Parameters
User$userUser object
Return values
booleanTrue if the user object was successfully loaded

◆ saveConsumerNonce()

enrol_lti\data_connector::saveConsumerNonce (   $nonce)

Save nonce object.

Parameters
ConsumerNonce$nonceNonce object
Return values
booleanTrue if the nonce object was successfully saved

◆ saveContext()

enrol_lti\data_connector::saveContext (   $context)

Save context object.

Parameters
Context$contextContext object
Return values
booleanTrue if the context object was successfully saved

◆ saveResourceLink()

enrol_lti\data_connector::saveResourceLink (   $resourcelink)

Save resource link object.

Parameters
ResourceLink$resourcelinkResource_Link object
Return values
booleanTrue if the resource link object was successfully saved

◆ saveResourceLinkShareKey()

enrol_lti\data_connector::saveResourceLinkShareKey (   $sharekey)

Save resource link share key object.

Parameters
ResourceLinkShareKey$sharekeyResource link share key object
Return values
booleanTrue if the resource link share key object was successfully saved

◆ saveToolConsumer()

enrol_lti\data_connector::saveToolConsumer (   $consumer)

Save tool consumer object.

Parameters
ToolConsumer$consumerConsumer object
Return values
booleanTrue if the tool consumer object was successfully saved

◆ saveToolProxy()

enrol_lti\data_connector::saveToolProxy (   $toolproxy)

Save the tool proxy to the database.

Parameters
ToolProxy$toolproxy
Return values
bool

◆ saveUser()

enrol_lti\data_connector::saveUser (   $user)

Save user object.

Parameters
User$userUser object
Return values
booleanTrue if the user object was successfully saved

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