LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
UserResult Class Reference

Class to represent a platform user association with a resource link. More...

Inheritance diagram for UserResult:
User

Public Member Functions

 __construct ()
 Class constructor.
 
 initialize ()
 Initialise the user.
 
 save ()
 Save the user to the database.
 
 delete ()
 Delete the user from the database.
 
 getResourceLink ()
 Get resource link.
 
 setResourceLink ($resourceLink)
 Set resource link.
 
 getRecordId ()
 Get record ID of user.
 
 setRecordId ($id)
 Set record ID of user.
 
 setResourceLinkId ($resourceLinkId)
 Set resource link ID of user.
 
 getDataConnector ()
 Get the data connector.
 
 setDataConnector ($dataConnector)
 Set the data connector.
 
 getId ($idScope=null, $source=null)
 Get the user ID (which may be a compound of the platform and resource link IDs).
 
- Public Member Functions inherited from User
 __construct ()
 Class constructor.
 
 initialize ()
 Initialise the user.
 
 initialise ()
 Initialise the user.
 
 setNames ($firstname, $lastname, $fullname, $middlename=null)
 Set the user's name.
 
 setEmail ($email, $defaultEmail=null)
 Set the user's email address.
 
 isLearner ()
 Check if the user is a learner.
 
 isInstructor ()
 Check if the user is an instructor.
 
 isContentDeveloper ()
 Check if the user is a content developer.
 
 isTeachingAssistant ()
 Check if the user is a teaching assistant.
 
 isManager ()
 Check if the user is a manager.
 
 isMember ()
 Check if the user is a member.
 
 isOfficer ()
 Check if the user is an officer.
 
 isStaff ()
 Check if the user is staff.
 
 isMentor ()
 Check if the user is a mentor.
 
 isAdmin ()
 Check if the user is an administrator (at any of the system, institution or context levels).
 

Static Public Member Functions

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

Data Fields

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

Additional Inherited Members

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

Detailed Description

Class to represent a platform user association with a resource link.

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

Definition at line 16 of file UserResult.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor.

Reimplemented from User.

Definition at line 71 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 108 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 261 of file UserResult.php.

◆ fromResourceLink()

static fromResourceLink (   $resourceLink,
  $ltiUserId 
)
static

Class constructor from resource link.

Parameters
ResourceLink | null$resourceLinkResourceLink object
string$ltiUserIdUserResult ID value
Returns
UserResult UserResult object

Definition at line 278 of file UserResult.php.

References User\$ltiUserId.

Referenced by ResourceLink\getMemberships().

◆ getDataConnector()

getDataConnector ( )

Get the data connector.

Returns
DataConnector|null Data connector object

Definition at line 175 of file UserResult.php.

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

◆ getId()

getId (   $idScope = null,
  $source = null 
)

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

Parameters
int$idScopeScope to use for user ID (optional, default is null for consumer default setting)
Context | Platform | null$sourceContext or Platform for user (optional)
Returns
string|null UserResult ID value, or null on error

Definition at line 198 of file UserResult.php.

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

◆ getRecordId()

getRecordId ( )

Get record ID of user.

Returns
int|null Record ID of user

Definition at line 144 of file UserResult.php.

◆ getResourceLink()

getResourceLink ( )

Get resource link.

Returns
ResourceLink Resource link object

Definition at line 120 of file UserResult.php.

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

Referenced by UserResult\getId().

◆ initialize()

initialize ( )

Initialise the user.

Reimplemented from User.

Definition at line 79 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 92 of file UserResult.php.

References UserResult\getDataConnector().

◆ setDataConnector()

setDataConnector (   $dataConnector)

Set the data connector.

Parameters
DataConnector | null$dataConnectorData connector object

Definition at line 185 of file UserResult.php.

◆ setRecordId()

setRecordId (   $id)

Set record ID of user.

Parameters
int | null$idRecord ID of user

Definition at line 154 of file UserResult.php.

◆ setResourceLink()

setResourceLink (   $resourceLink)

Set resource link.

Parameters
ResourceLink$resourceLinkResource link object

Definition at line 134 of file UserResult.php.

◆ setResourceLinkId()

setResourceLinkId (   $resourceLinkId)

Set resource link ID of user.

Parameters
int | null$resourceLinkIdResource link ID of user

Definition at line 164 of file UserResult.php.

Field Documentation

◆ $created

int null $created = null

Date/time the record was created.

Definition at line 31 of file UserResult.php.

◆ $ltiResultSourcedId

string null $ltiResultSourcedId = null

UserResult's result sourcedid.

Definition at line 24 of file UserResult.php.

◆ $updated

int null $updated = null

Date/time the record was last updated.

Definition at line 38 of file UserResult.php.


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