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

Class to represent a platform user. More...

+ Inheritance diagram for ceLTIc\LTI\User:

Public Member Functions

 __construct ()
 Class constructor.
 
void initialize ()
 Initialise the 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).
 

Public Attributes

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.
 

Static Public Attributes

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()

ceLTIc\LTI\User::__construct ( )

Class constructor.

Reimplemented in ceLTIc\LTI\UserResult.

References $fullname, $lastname, and $middlename.

Member Function Documentation

◆ initialise()

void ceLTIc\LTI\User::initialise ( )

Initialise the user.

Synonym for initialize().

◆ initialize()

void ceLTIc\LTI\User::initialize ( )

Initialise the user.

Reimplemented in ceLTIc\LTI\UserResult.

References $fullname.

◆ isAdmin()

bool ceLTIc\LTI\User::isAdmin ( )

Check if the user is an administrator (at any of the system, institution or context levels).

Returns
bool True if the user has a role of administrator

◆ isContentDeveloper()

bool ceLTIc\LTI\User::isContentDeveloper ( )

Check if the user is a content developer.

Returns
bool True if the user has a context role of ContentDeveloper

Referenced by isTeachingAssistant().

◆ isInstructor()

bool ceLTIc\LTI\User::isInstructor ( )

Check if the user is an instructor.

Returns
bool True if the user has a context role of Instructor

Referenced by isTeachingAssistant().

◆ isLearner()

bool ceLTIc\LTI\User::isLearner ( )

Check if the user is a learner.

Returns
bool True if the user has a context role of Learner

◆ isManager()

bool ceLTIc\LTI\User::isManager ( )

Check if the user is a manager.

Returns
bool True if the user has a context role of Manager

◆ isMember()

bool ceLTIc\LTI\User::isMember ( )

Check if the user is a member.

Returns
bool True if the user has a context role of Member

◆ isMentor()

bool ceLTIc\LTI\User::isMentor ( )

Check if the user is a mentor.

Returns
bool True if the user has a context role of Mentor

◆ isOfficer()

bool ceLTIc\LTI\User::isOfficer ( )

Check if the user is an officer.

Returns
bool True if the user has a context role of Officer

◆ isStaff()

bool ceLTIc\LTI\User::isStaff ( )

Check if the user is staff.

Returns
bool True if the user has a context role of Instructor, ContentDeveloper or TeachingAssistant

◆ isTeachingAssistant()

bool ceLTIc\LTI\User::isTeachingAssistant ( )

Check if the user is a teaching assistant.

Returns
bool True if the user has a context role of TeachingAssistant

References isContentDeveloper(), isInstructor(), and isTeachingAssistant().

Referenced by isTeachingAssistant().

◆ setEmail()

void ceLTIc\LTI\User::setEmail ( ?string $email,
?string $defaultEmail = null )

Set the user's email address.

Parameters
stringnull$emailEmail address value
string | null$defaultEmailValue to use if no email is provided (optional, default is none)

◆ setNames()

void ceLTIc\LTI\User::setNames ( string $firstname,
string $lastname,
string $fullname,
?string $middlename = null )

Set the user's name.

Parameters
string$firstnameUser's first name.
string$lastnameUser's last name.
string$fullnameUser's full name.
string | null$middlenameUser's middle name (optional, default is none).

Member Data Documentation

◆ $allowEmptyName

bool ceLTIc\LTI\User::$allowEmptyName = false
static

Allow user name field to be empty?

◆ $email

string ceLTIc\LTI\User::$email = ''

User's email address.

◆ $firstname

string ceLTIc\LTI\User::$firstname = ''

User's first name.

◆ $fullname

string ceLTIc\LTI\User::$fullname = ''

User's fullname.

Referenced by __construct(), and initialize().

◆ $groups

array ceLTIc\LTI\User::$groups = []

Groups for user.

◆ $image

string ceLTIc\LTI\User::$image = ''

User's image URI.

◆ $lastname

string ceLTIc\LTI\User::$lastname = ''

User's last name (surname or family name).

Referenced by __construct().

◆ $ltiUserId

string ceLTIc\LTI\User::$ltiUserId = null

user ID as supplied in the last connection request.

Referenced by ceLTIc\LTI\UserResult\setDataConnector().

◆ $middlename

string ceLTIc\LTI\User::$middlename = ''

User's middle name.

Referenced by __construct().

◆ $roles

array ceLTIc\LTI\User::$roles = []

Roles for user.

◆ $sourcedId

string ceLTIc\LTI\User::$sourcedId = null

User's sourcedId.

◆ $username

string ceLTIc\LTI\User::$username = null

User's username.

◆ PRINCIPAL_ROLES

const ceLTIc\LTI\User::PRINCIPAL_ROLES

List of principal roles for LTI 1.3.