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

Class to represent a platform user. More...

Inheritance diagram for UserResult:
User

Public Member Functions

 __construct ()
 Class constructor.
 
 initialize ()
 Initialise the user.
 
bool save ()
 Save the user to the database.
 
bool delete ()
 Delete the user from the database.
 
ResourceLink getResourceLink ()
 Get resource link.
 
 setResourceLink ($resourceLink)
 Set resource link.
 
int getRecordId ()
 Get record ID of user.
 
 setRecordId ($id)
 Set record ID of user.
 
 setResourceLinkId ($resourceLinkId)
 Set resource link ID of user.
 
mixed getDataConnector ()
 Get the data connector.
 
 setDataConnector ($dataConnector)
 Set the data connector.
 
string null 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.
 
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 ($id, $dataConnector)
 Load the user from the database.
 
static UserResult fromResourceLink ($resourceLink, $ltiUserId)
 Class constructor from resource link.
 

Public Attributes

string null $ltiResultSourcedId = null
 UserResult's result sourcedid.
 
datetime null $created = null
 Date/time the record was created.
 
datetime null $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 = array()
 Roles for user.
 
array $groups = array()
 Groups for user.
 
string null $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.

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.

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 (   $id,
  $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,
  $ltiUserId 
)
static

Class constructor from resource link.

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

◆ getDataConnector()

mixed getDataConnector ( )

Get the data connector.

Returns
mixed Data connector object or string

◆ getId()

string null 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

◆ getRecordId()

◆ getResourceLink()

ResourceLink getResourceLink ( )

Get resource link.

Returns
ResourceLink Resource link object

◆ initialize()

initialize ( )

Initialise the user.

Reimplemented from User.

References UserResult\initialize().

Referenced by UserResult\initialize().

◆ save()

bool save ( )

Save the user to the database.

Returns
bool True if the user object was successfully saved

◆ setDataConnector()

setDataConnector (   $dataConnector)

Set the data connector.

Parameters
DataConnector$dataConnectorData connector object

◆ setRecordId()

setRecordId (   $id)

Set record ID of user.

Parameters
int$idRecord ID of user

◆ setResourceLink()

setResourceLink (   $resourceLink)

Set resource link.

Parameters
ResourceLink$resourceLinkResource link object

◆ setResourceLinkId()

setResourceLinkId (   $resourceLinkId)

Set resource link ID of user.

Parameters
int$resourceLinkIdResource link ID of user

Member Data Documentation

◆ $created

datetime null $created = null

Date/time the record was created.

$created

◆ $ltiResultSourcedId

string null $ltiResultSourcedId = null

UserResult's result sourcedid.

$ltiResultSourcedId

◆ $updated

datetime null $updated = null

Date/time the record was last updated.

$updated


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