LTI Integration Library 5.2.0
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
ceLTIc\LTI\DataConnector\DataConnector Class Reference

Class to provide a connection to a persistent store for LTI objects. More...

+ Inheritance diagram for ceLTIc\LTI\DataConnector\DataConnector:

Public Member Functions

bool loadPlatform (Platform $platform)
 Load platform object.
 
bool savePlatform (Platform $platform)
 Save platform object.
 
bool deletePlatform (Platform $platform)
 Delete platform object.
 
Platform[] getPlatforms ()
 Load platform objects.
 
bool loadContext (Context $context)
 Load context object.
 
bool saveContext (Context $context)
 Save context object.
 
bool deleteContext (Context $context)
 Delete context object.
 
bool loadResourceLink (ResourceLink $resourceLink)
 Load resource link object.
 
bool saveResourceLink (ResourceLink $resourceLink)
 Save resource link object.
 
bool deleteResourceLink (ResourceLink $resourceLink)
 Delete resource link object.
 
UserResult[] getUserResultSourcedIDsResourceLink (ResourceLink $resourceLink, bool $localOnly, ?IdScope $idScope)
 Get array of user objects.
 
ResourceLinkShare[] getSharesResourceLink (ResourceLink $resourceLink)
 Get array of shares defined for this resource link.
 
bool loadPlatformNonce (PlatformNonce $nonce)
 Load nonce object.
 
bool savePlatformNonce (PlatformNonce $nonce)
 Save nonce object.
 
bool deletePlatformNonce (PlatformNonce $nonce)
 Delete nonce object.
 
bool loadAccessToken (AccessToken $accessToken)
 Load access token object.
 
bool saveAccessToken (AccessToken $accessToken)
 Save access token object.
 
bool loadResourceLinkShareKey (ResourceLinkShareKey $shareKey)
 Load resource link share key object.
 
bool saveResourceLinkShareKey (ResourceLinkShareKey $shareKey)
 Save resource link share key object.
 
bool deleteResourceLinkShareKey (ResourceLinkShareKey $shareKey)
 Delete resource link share key object.
 
bool loadUserResult (UserResult $userResult)
 Load user object.
 
bool saveUserResult (UserResult $userResult)
 Save user object.
 
bool deleteUserResult (UserResult $userResult)
 Delete user object.
 
bool loadTool (Tool $tool)
 Load tool object.
 
bool saveTool (Tool $tool)
 Save tool object.
 
bool deleteTool (Tool $tool)
 Delete tool object.
 
Tool[] getTools ()
 Load tool objects.
 

Static Public Member Functions

static bool useMemcache (?string $host=null, int $port=-1)
 Set/check whether memcached should be used when available.
 
static DataConnector getDataConnector (mixed $db=null, string $dbTableNamePrefix='', string $type='')
 Create data connector object.
 

Public Attributes

const PLATFORM_TABLE_NAME = 'lti2_consumer'
 Default name for database table used to store platforms.
 
const CONTEXT_TABLE_NAME = 'lti2_context'
 Default name for database table used to store contexts.
 
const RESOURCE_LINK_TABLE_NAME = 'lti2_resource_link'
 Default name for database table used to store resource links.
 
const USER_RESULT_TABLE_NAME = 'lti2_user_result'
 Default name for database table used to store users.
 
const RESOURCE_LINK_SHARE_KEY_TABLE_NAME = 'lti2_share_key'
 Default name for database table used to store resource link share keys.
 
const NONCE_TABLE_NAME = 'lti2_nonce'
 Default name for database table used to store nonce values.
 
const ACCESS_TOKEN_TABLE_NAME = 'lti2_access_token'
 Default name for database table used to store access token values.
 
const TOOL_TABLE_NAME = 'lti2_tool'
 Default name for database table used to store tools.
 

Protected Member Functions

 __construct (mixed $db, string $dbTableNamePrefix='')
 Class constructor.
 
void fixPlatformSettings (Platform $platform, bool $isSave)
 Adjust the settings for any platform properties being stored as a setting value.
 
void fixToolSettings (Tool $tool, bool $isSave)
 Adjust the settings for any tool properties being stored as a setting value.
 
string dbTableName (string $table)
 Add the prefix to the name for a database table.
 

Protected Attributes

mixed $db = null
 Database connection.
 
string $dbTableNamePrefix = ''
 Prefix for database table names.
 
string $dateFormat = 'Y-m-d'
 SQL date format (default = 'Y-m-d')
 
string $timeFormat = 'H:i:s'
 SQL time format (default = 'H:i:s')
 

Detailed Description

Class to provide a connection to a persistent store for LTI objects.

This class assumes no data persistence - it should be extended for specific database connections.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

ceLTIc\LTI\DataConnector\DataConnector::__construct ( mixed $db,
string $dbTableNamePrefix = '' )
protected

Class constructor.

Parameters
object | resource$dbDatabase connection object
string$dbTableNamePrefixPrefix for database table names (optional, default is none)

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_oci8.

Member Function Documentation

◆ dbTableName()

string ceLTIc\LTI\DataConnector\DataConnector::dbTableName ( string $table)
protected

Add the prefix to the name for a database table.

Parameters
string$tableName of table without prefix
Returns
string The fullname of the database table

Referenced by ceLTIc\LTI\DataConnector\DataConnector_oci8\__construct(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\deleteContext(), ceLTIc\LTI\DataConnector\DataConnector_sql\deleteContext(), ceLTIc\LTI\DataConnector\DataConnector_oci8\deletePlatform(), ceLTIc\LTI\DataConnector\DataConnector_pdo\deletePlatform(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\deletePlatform(), ceLTIc\LTI\DataConnector\DataConnector_sql\deletePlatform(), ceLTIc\LTI\DataConnector\DataConnector_oci8\deletePlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_pdo\deletePlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\deleteResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_sql\deleteResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\deleteResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\deleteUserResult(), ceLTIc\LTI\DataConnector\DataConnector_sql\deleteUserResult(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\getSharesResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_oci8\getSharesResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_pdo\getSharesResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\getSharesResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_sql\getSharesResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\getUserResultSourcedIDsResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\getUserResultSourcedIDsResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadPlatform(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadPlatform(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadPlatform(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadPlatform(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadPlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadPlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadPlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadPlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadPlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_sql\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\saveAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\saveAccessToken(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\saveContext(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\savePlatform(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\savePlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_sql\savePlatformNonce(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\saveResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_sql\saveResourceLink(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\saveUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pdo\saveUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\saveUserResult(), and ceLTIc\LTI\DataConnector\DataConnector_sql\saveUserResult().

◆ deleteContext()

bool ceLTIc\LTI\DataConnector\DataConnector::deleteContext ( Context $context)

Delete context object.

Parameters
Context$contextContext object
Returns
bool True if the Context object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References deleteResourceLink(), and ceLTIc\LTI\ResourceLink\initialize().

Referenced by getPlatforms().

◆ deletePlatform()

bool ceLTIc\LTI\DataConnector\DataConnector::deletePlatform ( Platform $platform)

Delete platform object.

Parameters
Platform$platformPlatform object
Returns
bool True if the platform object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References saveContext().

◆ deletePlatformNonce()

bool ceLTIc\LTI\DataConnector\DataConnector::deletePlatformNonce ( PlatformNonce $nonce)

Delete nonce object.

Parameters
PlatformNonce$nonceNonce object
Returns
bool True if the nonce object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

Referenced by loadPlatformNonce().

◆ deleteResourceLink()

bool ceLTIc\LTI\DataConnector\DataConnector::deleteResourceLink ( ResourceLink $resourceLink)

◆ deleteResourceLinkShareKey()

bool ceLTIc\LTI\DataConnector\DataConnector::deleteResourceLinkShareKey ( ResourceLinkShareKey $shareKey)

Delete resource link share key object.

Parameters
ResourceLinkShareKey$shareKeyResource link share key object
Returns
bool True if the resource link share key object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References deleteUserResult(), and ceLTIc\LTI\UserResult\initialize().

◆ deleteTool()

bool ceLTIc\LTI\DataConnector\DataConnector::deleteTool ( Tool $tool)

Delete tool object.

Parameters
Tool$toolTool object
Returns
bool True if the tool object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References $dbTableNamePrefix.

◆ deleteUserResult()

bool ceLTIc\LTI\DataConnector\DataConnector::deleteUserResult ( UserResult $userResult)

Delete user object.

Parameters
UserResult$userResultUserResult object
Returns
bool True if the user object was successfully deleted

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

Referenced by deleteResourceLinkShareKey().

◆ fixPlatformSettings()

void ceLTIc\LTI\DataConnector\DataConnector::fixPlatformSettings ( Platform $platform,
bool $isSave )
protected

Adjust the settings for any platform properties being stored as a setting value.

Parameters
Platform$platformPlatform object
bool$isSaveTrue if the settings are being saved

References ceLTIc\LTI\Util\$logLevel.

◆ fixToolSettings()

void ceLTIc\LTI\DataConnector\DataConnector::fixToolSettings ( Tool $tool,
bool $isSave )
protected

Adjust the settings for any tool properties being stored as a setting value.

Parameters
Tool$toolTool object
bool$isSaveTrue if the settings are being saved

◆ getDataConnector()

static DataConnector ceLTIc\LTI\DataConnector\DataConnector::getDataConnector ( mixed $db = null,
string $dbTableNamePrefix = '',
string $type = '' )
static

Create data connector object.

A data connector provides access to persistent storage for the different objects.

Names of tables may be given a prefix to allow multiple versions to share the same schema. A separate sub-class is defined for each different database connection - the class to use is determined by inspecting the database object passed, but this can be overridden (for example, to use a bespoke connector) by specifying a type. If no database is passed then this class is used which acts as a dummy connector with no persistence.

Parameters
object | resource$dbA database connection object or string (optional, default is no persistence)
string$dbTableNamePrefixPrefix for database table names (optional, default is none)
string$typeThe type of data connector (optional, default is based on $db parameter)
Returns
DataConnector Data connector object

References ceLTIc\LTI\Util\$logLevel.

Referenced by saveTool().

◆ getPlatforms()

Platform[] ceLTIc\LTI\DataConnector\DataConnector::getPlatforms ( )

◆ getSharesResourceLink()

ResourceLinkShare[] ceLTIc\LTI\DataConnector\DataConnector::getSharesResourceLink ( ResourceLink $resourceLink)

Get array of shares defined for this resource link.

Parameters
ResourceLink$resourceLinkResourceLink object
Returns
ResourceLinkShare[] Array of ResourceLinkShare objects

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

Referenced by saveResourceLink().

◆ getTools()

Tool[] ceLTIc\LTI\DataConnector\DataConnector::getTools ( )

◆ getUserResultSourcedIDsResourceLink()

UserResult[] ceLTIc\LTI\DataConnector\DataConnector::getUserResultSourcedIDsResourceLink ( ResourceLink $resourceLink,
bool $localOnly,
?IdScope $idScope )

Get array of user objects.

Obtain an array of UserResult 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
bool$localOnlyTrue if only users within the resource link are to be returned (excluding users sharing this resource link)
IdScope | null$idScopeScope value to use for user IDs
Returns
UserResult[] Array of UserResult objects

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pdo_pgsql, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References savePlatformNonce().

Referenced by loadResourceLink().

◆ loadAccessToken()

bool ceLTIc\LTI\DataConnector\DataConnector::loadAccessToken ( AccessToken $accessToken)

Load access token object.

Parameters
AccessToken$accessTokenAccess token object
Returns
bool True if the nonce object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

Referenced by savePlatformNonce().

◆ loadContext()

bool ceLTIc\LTI\DataConnector\DataConnector::loadContext ( Context $context)

Load context object.

Parameters
Context$contextContext object
Returns
bool True if the context object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References loadResourceLink().

Referenced by savePlatform().

◆ loadPlatform()

bool ceLTIc\LTI\DataConnector\DataConnector::loadPlatform ( Platform $platform)

Load platform object.

Parameters
Platform$platformPlatform object
Returns
bool True if the platform object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References getPlatforms().

Referenced by useMemcache().

◆ loadPlatformNonce()

bool ceLTIc\LTI\DataConnector\DataConnector::loadPlatformNonce ( PlatformNonce $nonce)

◆ loadResourceLink()

bool ceLTIc\LTI\DataConnector\DataConnector::loadResourceLink ( ResourceLink $resourceLink)

Load resource link object.

Parameters
ResourceLink$resourceLinkResourceLink object
Returns
bool True if the resource link object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References getUserResultSourcedIDsResourceLink().

Referenced by loadContext().

◆ loadResourceLinkShareKey()

bool ceLTIc\LTI\DataConnector\DataConnector::loadResourceLinkShareKey ( ResourceLinkShareKey $shareKey)

Load resource link share key object.

Parameters
ResourceLinkShareKey$shareKeyResourceLink share key object
Returns
bool True if the resource link share key object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References loadUserResult().

◆ loadTool()

bool ceLTIc\LTI\DataConnector\DataConnector::loadTool ( Tool $tool)

Load tool object.

Parameters
Tool$toolTool object
Returns
bool True if the tool object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References getTools().

Referenced by loadUserResult().

◆ loadUserResult()

bool ceLTIc\LTI\DataConnector\DataConnector::loadUserResult ( UserResult $userResult)

Load user object.

Parameters
UserResult$userResultUserResult object
Returns
bool True if the user object was successfully loaded

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References loadTool().

Referenced by loadResourceLinkShareKey().

◆ saveAccessToken()

bool ceLTIc\LTI\DataConnector\DataConnector::saveAccessToken ( AccessToken $accessToken)

Save access token object.

Parameters
AccessToken$accessTokenAccess token object
Returns
bool True if the access token object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References saveResourceLinkShareKey().

◆ saveContext()

bool ceLTIc\LTI\DataConnector\DataConnector::saveContext ( Context $context)

Save context object.

Parameters
Context$contextContext object
Returns
bool True if the context object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References saveResourceLink().

Referenced by deletePlatform().

◆ savePlatform()

bool ceLTIc\LTI\DataConnector\DataConnector::savePlatform ( Platform $platform)

Save platform object.

Parameters
Platform$platformPlatform object
Returns
bool True if the platform object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References loadContext().

◆ savePlatformNonce()

bool ceLTIc\LTI\DataConnector\DataConnector::savePlatformNonce ( PlatformNonce $nonce)

◆ saveResourceLink()

bool ceLTIc\LTI\DataConnector\DataConnector::saveResourceLink ( ResourceLink $resourceLink)

Save resource link object.

Parameters
ResourceLink$resourceLinkResourceLink object
Returns
bool True if the resource link object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References getSharesResourceLink().

Referenced by saveContext().

◆ saveResourceLinkShareKey()

bool ceLTIc\LTI\DataConnector\DataConnector::saveResourceLinkShareKey ( ResourceLinkShareKey $shareKey)

Save resource link share key object.

Parameters
ResourceLinkShareKey$shareKeyResource link share key object
Returns
bool True if the resource link share key object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pdo_pgsql, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

References saveUserResult().

Referenced by saveAccessToken().

◆ saveTool()

bool ceLTIc\LTI\DataConnector\DataConnector::saveTool ( Tool $tool)

◆ saveUserResult()

bool ceLTIc\LTI\DataConnector\DataConnector::saveUserResult ( UserResult $userResult)

Save user object.

Parameters
UserResult$userResultUserResult object
Returns
bool True if the user object was successfully saved

Reimplemented in ceLTIc\LTI\DataConnector\DataConnector_mysqli, ceLTIc\LTI\DataConnector\DataConnector_oci8, ceLTIc\LTI\DataConnector\DataConnector_pdo, ceLTIc\LTI\DataConnector\DataConnector_pgsql, and ceLTIc\LTI\DataConnector\DataConnector_sql.

Referenced by saveResourceLinkShareKey().

◆ useMemcache()

static bool ceLTIc\LTI\DataConnector\DataConnector::useMemcache ( ?string $host = null,
int $port = -1 )
static

Set/check whether memcached should be used when available.

Parameters
string$hostName or IP address of host running memcache server (use an empty string to disable)
int$portPort number used by memcache server (use -1 for default)
Returns
bool True if memcache is enabled

References loadPlatform().

Member Data Documentation

◆ $dateFormat

string ceLTIc\LTI\DataConnector\DataConnector::$dateFormat = 'Y-m-d'
protected

SQL date format (default = 'Y-m-d')

◆ $db

mixed ceLTIc\LTI\DataConnector\DataConnector::$db = null
protected

Database connection.

Referenced by saveTool().

◆ $dbTableNamePrefix

string ceLTIc\LTI\DataConnector\DataConnector::$dbTableNamePrefix = ''
protected

Prefix for database table names.

Referenced by deleteTool(), and saveTool().

◆ $timeFormat

string ceLTIc\LTI\DataConnector\DataConnector::$timeFormat = 'H:i:s'
protected

SQL time format (default = 'H:i:s')

◆ ACCESS_TOKEN_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::ACCESS_TOKEN_TABLE_NAME = 'lti2_access_token'

Default name for database table used to store access token values.

◆ CONTEXT_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::CONTEXT_TABLE_NAME = 'lti2_context'

Default name for database table used to store contexts.

◆ NONCE_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::NONCE_TABLE_NAME = 'lti2_nonce'

Default name for database table used to store nonce values.

◆ PLATFORM_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::PLATFORM_TABLE_NAME = 'lti2_consumer'

Default name for database table used to store platforms.

◆ RESOURCE_LINK_SHARE_KEY_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::RESOURCE_LINK_SHARE_KEY_TABLE_NAME = 'lti2_share_key'

Default name for database table used to store resource link share keys.

◆ RESOURCE_LINK_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::RESOURCE_LINK_TABLE_NAME = 'lti2_resource_link'

Default name for database table used to store resource links.

◆ TOOL_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::TOOL_TABLE_NAME = 'lti2_tool'

Default name for database table used to store tools.

◆ USER_RESULT_TABLE_NAME

const ceLTIc\LTI\DataConnector\DataConnector::USER_RESULT_TABLE_NAME = 'lti2_user_result'

Default name for database table used to store users.