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

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

+ Inheritance diagram for ceLTIc\LTI\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 ceLTIc\LTI\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 ceLTIc\LTI\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 ceLTIc\LTI\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()

ceLTIc\LTI\UserResult::__construct ( )

Class constructor.

Reimplemented from ceLTIc\LTI\User.

References getDataConnector().

Member Function Documentation

◆ delete()

bool ceLTIc\LTI\UserResult::delete ( )

Delete the user from the database.

Returns
bool True if the user object was successfully deleted

◆ fromRecordId()

static UserResult ceLTIc\LTI\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

References getDataConnector(), and initialize().

◆ fromResourceLink()

static UserResult ceLTIc\LTI\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 ceLTIc\LTI\UserResult::getDataConnector ( )

Get the data connector.

Returns
DataConnector|null Data connector object

Referenced by __construct(), fromRecordId(), and initialize().

◆ getId()

string null ceLTIc\LTI\UserResult::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 ceLTIc\LTI\DataConnector\DataConnector_mysqli\deleteResourceLinkShareKey(), ceLTIc\LTI\DataConnector\DataConnector_mysqli\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_oci8\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pdo\loadUserResult(), ceLTIc\LTI\DataConnector\DataConnector_pgsql\loadUserResult(), and ceLTIc\LTI\DataConnector\DataConnector_sql\loadUserResult().

◆ getRecordId()

◆ getResourceLink()

◆ initialize()

◆ save()

bool ceLTIc\LTI\UserResult::save ( )

Save the user to the database.

Returns
bool True if the user object was successfully saved

◆ setDataConnector()

void ceLTIc\LTI\UserResult::setDataConnector ( ?DataConnector $dataConnector)

Set the data connector.

Parameters
DataConnector | null$dataConnectorData connector object

References ceLTIc\LTI\User\$ltiUserId.

◆ setRecordId()

◆ setResourceLink()

void ceLTIc\LTI\UserResult::setResourceLink ( ResourceLink $resourceLink)

Set resource link.

Parameters
ResourceLink$resourceLinkResource link object

◆ setResourceLinkId()

void ceLTIc\LTI\UserResult::setResourceLinkId ( ?int $resourceLinkId)

Set resource link ID of user.

Parameters
int | null$resourceLinkIdResource link ID of user

Member Data Documentation

◆ $created

int ceLTIc\LTI\UserResult::$created = null

Date/time the record was created.

◆ $ltiResultSourcedId

string ceLTIc\LTI\UserResult::$ltiResultSourcedId = null

UserResult's result sourcedid.

◆ $updated

int ceLTIc\LTI\UserResult::$updated = null

Date/time the record was last updated.