Class to represent a tool consumer

author Stephen P Vickers
version 2.5.00
license GNU Lesser General Public License, version 3
package LTI

 Methods

Class constructor.

__construct(string $key = NULL, mixed $data_connector = '', boolean $autoEnable = FALSE

Parameters

$key

string

Consumer key

$data_connector

mixed

String containing table name prefix, or database connection object, or array containing one or both values (optional, default is MySQL with an empty table name prefix)

$autoEnable

boolean

true if the tool consumers is to be enabled automatically (optional, default is false)

Delete the tool consumer from the database.

delete() : boolean

Returns

booleanTrue if the object was successfully deleted

Get the data connector.

getDataConnector() : mixed

Returns

mixedData connector object or string

Is the consumer key available to accept launch requests?

getIsAvailable() : boolean

Returns

booleanTrue if the consumer key is enabled and within any date constraints

Get the tool consumer key.

getKey() : string

Returns

stringConsumer key value

Initialise the tool consumer.

initialise() 

Save the tool consumer to the database.

save() : boolean

Returns

booleanTrue if the object was successfully saved

Add the OAuth signature to an LTI message.

signParameters(string $url, string $type, string $version, array $params) : array

Parameters

$url

string

URL for message request

$type

string

LTI message type

$version

string

LTI version

$params

array

Message parameters

Returns

arrayArray of signed message parameters

Load the tool consumer from the database.

load(string $key, boolean $autoEnable = FALSE) : boolean

Parameters

$key

string

The consumer key value

$autoEnable

boolean

True if the consumer should be enabled (optional, default if false)

Returns

booleanTrue if the consumer was successfully loaded

 Properties

 

Tool consumer GUID (as reported by first tool consumer connection).

$consumer_guid : string

Default

NULL
 

Name of tool consumer (as reported by last tool consumer connection).

$consumer_name : string

Default

NULL
 

Tool consumer version (as reported by last tool consumer connection).

$consumer_version : string

Default

NULL
 

Date/time when the object was created.

$created : object

Default

NULL
 

Optional CSS path (as reported by last tool consumer connection).

$css_path : string

Default

NULL
 

Default email address (or email domain) to use when no email address is provided for a user.

$defaultEmail : string

Default

''
 

Date/time from which the the tool consumer instance is enabled to accept incoming connection requests.

$enable_from : object

Default

NULL
 

Date/time until which the tool consumer instance is enabled to accept incoming connection requests.

$enable_until : object

Default

NULL
 

Whether the tool consumer instance is enabled to accept incoming connection requests.

$enabled : boolean

Default

FALSE
 

Default scope to use when generating an Id value for a user.

$id_scope : integer

Default

\LTI_Tool_Provider::ID_SCOPE_ID_ONLY
 

Date of last connection from this tool consumer.

$last_access : object

Default

NULL
 

LTI version (as reported by last tool consumer connection).

$lti_version : string

Default

NULL
 

Local name of tool consumer.

$name : string

Default

NULL
 

Whether the tool consumer instance is protected by matching the consumer_guid value in incoming requests.

$protected : boolean

Default

FALSE
 

Shared secret.

$secret : string

Default

NULL
 

Date/time when the object was last updated.

$updated : object

Default

NULL
 

Data connector object or string.

$data_connector : mixed

Default

NULL
 

Consumer key value.

$key : string

Default

NULL