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

Class to represent a platform user. More...

Inheritance diagram for User:
UserResult

Public Member Functions

 __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).
 

Data Fields

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.
 

Static Public Attributes

static $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

Definition at line 12 of file User.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor.

Reimplemented in UserResult.

Definition at line 137 of file User.php.

References User\initialize().

Member Function Documentation

◆ initialise()

initialise ( )

Initialise the user.

Synonym for initialize().

Definition at line 164 of file User.php.

References User\initialize().

◆ initialize()

initialize ( )

Initialise the user.

Reimplemented in UserResult.

Definition at line 145 of file User.php.

Referenced by User\__construct(), and User\initialise().

◆ isAdmin()

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

Definition at line 342 of file User.php.

◆ isContentDeveloper()

isContentDeveloper ( )

Check if the user is a content developer.

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

Definition at line 272 of file User.php.

Referenced by User\isStaff().

◆ isInstructor()

isInstructor ( )

Check if the user is an instructor.

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

Definition at line 262 of file User.php.

Referenced by User\isStaff().

◆ isLearner()

isLearner ( )

Check if the user is a learner.

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

Definition at line 252 of file User.php.

◆ isManager()

isManager ( )

Check if the user is a manager.

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

Definition at line 292 of file User.php.

◆ isMember()

isMember ( )

Check if the user is a member.

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

Definition at line 302 of file User.php.

◆ isMentor()

isMentor ( )

Check if the user is a mentor.

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

Definition at line 332 of file User.php.

◆ isOfficer()

isOfficer ( )

Check if the user is an officer.

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

Definition at line 312 of file User.php.

◆ isStaff()

isStaff ( )

Check if the user is staff.

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

Definition at line 322 of file User.php.

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

◆ isTeachingAssistant()

isTeachingAssistant ( )

Check if the user is a teaching assistant.

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

Definition at line 282 of file User.php.

Referenced by User\isStaff().

◆ setEmail()

setEmail (   $email,
  $defaultEmail = null 
)

Set the user's email address.

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

Definition at line 229 of file User.php.

References User\$email.

◆ setNames()

setNames (   $firstname,
  $lastname,
  $fullname,
  $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).

Definition at line 177 of file User.php.

References User\$firstname, User\$fullname, User\$lastname, User\$ltiUserId, and User\$middlename.

Field Documentation

◆ $allowEmptyName

bool $allowEmptyName = false
static

Allow user name field to be empty?

Definition at line 83 of file User.php.

◆ $email

string $email = ''

User's email address.

Definition at line 104 of file User.php.

Referenced by User\setEmail().

◆ $firstname

string $firstname = ''

User's first name.

Definition at line 55 of file User.php.

Referenced by User\setNames().

◆ $fullname

string $fullname = ''

User's fullname.

Definition at line 76 of file User.php.

Referenced by User\setNames().

◆ $groups

array $groups = array()

Groups for user.

Definition at line 125 of file User.php.

◆ $image

string $image = ''

User's image URI.

Definition at line 111 of file User.php.

◆ $lastname

string $lastname = ''

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

Definition at line 69 of file User.php.

Referenced by User\setNames().

◆ $ltiUserId

string null $ltiUserId = null

user ID as supplied in the last connection request.

Definition at line 132 of file User.php.

Referenced by UserResult\fromResourceLink(), UserResult\getId(), and User\setNames().

◆ $middlename

string $middlename = ''

User's middle name.

Definition at line 62 of file User.php.

Referenced by User\setNames().

◆ $roles

array $roles = array()

Roles for user.

Definition at line 118 of file User.php.

◆ $sourcedId

string null $sourcedId = null

User's sourcedId.

Definition at line 90 of file User.php.

◆ $username

string null $username = null

User's username.

Definition at line 97 of file User.php.

◆ PRINCIPAL_ROLES

const PRINCIPAL_ROLES

List of principal roles for LTI 1.3.

Definition at line 18 of file User.php.


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