LTI Integration Library  3.1.0
PHP class library for building LTI integrations
UserResult Class Reference

Class to represent a tool consumer user. More...

Inheritance diagram for UserResult:
User

Public Member Functions

 __construct ()
 Class constructor. More...
 
 initialize ()
 Initialise the user. More...
 
 save ()
 Save the user to the database. More...
 
 delete ()
 Delete the user from the database. More...
 
 getResourceLink ()
 Get resource link. More...
 
 setResourceLink ($resourceLink)
 Set resource link. More...
 
 getRecordId ()
 Get record ID of user. More...
 
 setRecordId ($id)
 Set record ID of user. More...
 
 setResourceLinkId ($resourceLinkId)
 Set resource link ID of user. More...
 
 getDataConnector ()
 Get the data connector. More...
 
 setDataConnector ($dataConnector)
 Set the data connector. More...
 
 getId ($idScope=null)
 Get the user ID (which may be a compound of the tool consumer and resource link IDs). More...
 
- Public Member Functions inherited from User
 __construct ()
 Class constructor. More...
 
 initialize ()
 Initialise the user. More...
 
 initialise ()
 Initialise the user. More...
 
 setNames ($firstname, $lastname, $fullname)
 Set the user's name. More...
 
 setEmail ($email, $defaultEmail=null)
 Set the user's email address. More...
 
 isAdmin ()
 Check if the user is an administrator (at any of the system, institution or context levels). More...
 
 isStaff ()
 Check if the user is staff. More...
 
 isLearner ()
 Check if the user is a learner. More...
 

Static Public Member Functions

static fromRecordId ($id, $dataConnector)
 Load the user from the database. More...
 
static fromResourceLink ($resourceLink, $ltiUserId)
 Class constructor from resource link. More...
 

Data Fields

 $ltiResultSourcedId = null
 UserResult's result sourcedid. More...
 
 $created = null
 Date/time the record was created. More...
 
 $updated = null
 Date/time the record was last updated. More...
 
- Data Fields inherited from User
 $firstname = ''
 UserResult's first name. More...
 
 $lastname = ''
 UserResult's last name (surname or family name). More...
 
 $fullname = ''
 UserResult's fullname. More...
 
 $email = ''
 UserResult's email address. More...
 
 $image = ''
 UserResult's image URI. More...
 
 $roles = array()
 Roles for user. More...
 
 $groups = array()
 Groups for user. More...
 
 $ltiUserId = null
 user ID as supplied in the last connection request. More...
 

Additional Inherited Members

- Static Public Attributes inherited from User
static $allowEmptyName = false
 Allow user name field to be empty? More...
 

Detailed Description

Class to represent a tool consumer user.

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

Definition at line 15 of file UserResult.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor.

Definition at line 70 of file UserResult.php.

References UserResult\initialize().

Member Function Documentation

◆ delete()

delete ( )

Delete the user from the database.

Returns
bool True if the user object was successfully deleted

Definition at line 107 of file UserResult.php.

References UserResult\getDataConnector().

◆ fromRecordId()

static fromRecordId (   $id,
  $dataConnector 
)
static

Load the user from the database.

Parameters
int$idRecord ID of user
DataConnector$dataConnectorDatabase connection object
Returns
UserResult UserResult object

Definition at line 238 of file UserResult.php.

Referenced by DataConnector_pdo_pgsql\getUserResultSourcedIDsResourceLink(), DataConnector_oci\getUserResultSourcedIDsResourceLink(), and DataConnector_pdo\getUserResultSourcedIDsResourceLink().

◆ fromResourceLink()

static fromResourceLink (   $resourceLink,
  $ltiUserId 
)
static

◆ getDataConnector()

getDataConnector ( )

Get the data connector.

Returns
mixed Data connector object or string

Definition at line 173 of file UserResult.php.

Referenced by UserResult\delete(), UserResult\getResourceLink(), and UserResult\save().

◆ getId()

getId (   $idScope = null)

Get the user ID (which may be a compound of the tool consumer and resource link IDs).

Parameters
int$idScopeScope to use for user ID (optional, default is null for consumer default setting)
Returns
string UserResult ID value

Definition at line 195 of file UserResult.php.

References User\$ltiUserId, UserResult\getResourceLink(), ToolProvider\ID_SCOPE_CONTEXT, ToolProvider\ID_SCOPE_GLOBAL, ToolProvider\ID_SCOPE_ID_ONLY, ToolProvider\ID_SCOPE_RESOURCE, and ToolProvider\ID_SCOPE_SEPARATOR.

◆ getRecordId()

getRecordId ( )

Get record ID of user.

Returns
int Record ID of user

Definition at line 143 of file UserResult.php.

◆ getResourceLink()

getResourceLink ( )

Get resource link.

Returns
ResourceLink Resource link object

Definition at line 119 of file UserResult.php.

References ResourceLink\fromRecordId(), and UserResult\getDataConnector().

Referenced by UserResult\getId().

◆ initialize()

initialize ( )

Initialise the user.

Definition at line 78 of file UserResult.php.

Referenced by UserResult\__construct().

◆ save()

save ( )

Save the user to the database.

Returns
bool True if the user object was successfully saved

Definition at line 91 of file UserResult.php.

References UserResult\getDataConnector().

◆ setDataConnector()

setDataConnector (   $dataConnector)

Set the data connector.

Parameters
DataConnector$dataConnectorData connector object

Definition at line 183 of file UserResult.php.

◆ setRecordId()

setRecordId (   $id)

Set record ID of user.

Parameters
int$idRecord ID of user

Definition at line 153 of file UserResult.php.

◆ setResourceLink()

setResourceLink (   $resourceLink)

Set resource link.

Parameters
ResourceLink$resourceLinkResource link object

Definition at line 133 of file UserResult.php.

◆ setResourceLinkId()

setResourceLinkId (   $resourceLinkId)

Set resource link ID of user.

Parameters
int$resourceLinkIdResource link ID of user

Definition at line 163 of file UserResult.php.

Field Documentation

◆ $created

datetime null $created = null

Date/time the record was created.

Definition at line 30 of file UserResult.php.

◆ $ltiResultSourcedId

string null $ltiResultSourcedId = null

UserResult's result sourcedid.

Definition at line 23 of file UserResult.php.

◆ $updated

datetime null $updated = null

Date/time the record was last updated.

Definition at line 37 of file UserResult.php.


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