LTI Integration Library 5.1.4
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:

Public Member Functions

 __construct ()
 Class constructor.
 
void initialize ()
 Initialise the user.
 
bool save ()
 Save the user to the database.
 
bool delete ()
 Delete the user from the database.
 
ResourceLink null getResourceLink ()
 Get resource link.
 
void setResourceLink (ResourceLink $resourceLink)
 Set resource link.
 
int null getRecordId ()
 Get record ID of user.
 
void setRecordId (?int $id)
 Set record ID of user.
 
void setResourceLinkId (?int $resourceLinkId)
 Set resource link ID of user.
 
DataConnector null getDataConnector ()
 Get the data connector.
 
void setDataConnector (?DataConnector $dataConnector)
 Set the data connector.
 
string null getId (?IdScope $idScope=null, Context|Platform|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
void initialise ()
 Initialise the user.
 
void setNames (string $firstname, string $lastname, string $fullname, ?string $middlename=null)
 Set the user's name.
 
void setEmail (?string $email, ?string $defaultEmail=null)
 Set the user's email address.
 
bool isLearner ()
 Check if the user is a learner.
 
bool isInstructor ()
 Check if the user is an instructor.
 
bool isContentDeveloper ()
 Check if the user is a content developer.
 
bool isTeachingAssistant ()
 Check if the user is a teaching assistant.
 
bool isManager ()
 Check if the user is a manager.
 
bool isMember ()
 Check if the user is a member.
 
bool isOfficer ()
 Check if the user is an officer.
 
bool isStaff ()
 Check if the user is staff.
 
bool isMentor ()
 Check if the user is a mentor.
 
bool isAdmin ()
 Check if the user is an administrator (at any of the system, institution or context levels).
 

Static Public Member Functions

static UserResult fromRecordId (int $id, DataConnector $dataConnector)
 Load the user from the database.
 
static UserResult fromResourceLink (?ResourceLink $resourceLink, string $ltiUserId)
 Class constructor from resource link.
 

Public Attributes

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

Additional Inherited Members

- Static Public Attributes inherited from User
static bool $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

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor.

Reimplemented from User.

References UserResult\getDataConnector().

Member Function Documentation

◆ delete()

bool delete ( )

Delete the user from the database.

Returns
bool True if the user object was successfully deleted

◆ fromRecordId()

static UserResult fromRecordId ( int $id,
DataConnector $dataConnector )
static

Load the user from the database.

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

◆ fromResourceLink()

static UserResult fromResourceLink ( ?ResourceLink $resourceLink,
string $ltiUserId )
static

Class constructor from resource link.

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

◆ getDataConnector()

DataConnector null getDataConnector ( )

Get the data connector.

Returns
DataConnector|null Data connector object

Referenced by UserResult\__construct().

◆ getId()

string null getId ( ?IdScope $idScope = null,
Context|Platform|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

Referenced by DataConnector_mysqli\deleteResourceLinkShareKey(), DataConnector_mysqli\loadUserResult(), DataConnector_oci8\loadUserResult(), and DataConnector_pdo\loadUserResult().

◆ getRecordId()

int null getRecordId ( )

◆ getResourceLink()

ResourceLink null getResourceLink ( )

◆ initialize()

void initialize ( )

Initialise the user.

Reimplemented from User.

Referenced by DataConnector_sql\saveUserResult().

◆ save()

bool save ( )

Save the user to the database.

Returns
bool True if the user object was successfully saved

◆ setDataConnector()

void setDataConnector ( ?DataConnector $dataConnector)

Set the data connector.

Parameters
DataConnector | null$dataConnectorData connector object

References User\$ltiUserId.

◆ setRecordId()

void setRecordId ( ?int $id)

Set record ID of user.

Parameters
int | null$idRecord ID of user

Referenced by DataConnector_mysqli\loadUserResult(), DataConnector_oci8\loadUserResult(), and DataConnector_pdo\loadUserResult().

◆ setResourceLink()

void setResourceLink ( ResourceLink $resourceLink)

Set resource link.

Parameters
ResourceLink$resourceLinkResource link object

◆ setResourceLinkId()

void setResourceLinkId ( ?int $resourceLinkId)

Set resource link ID of user.

Parameters
int | null$resourceLinkIdResource link ID of user