Class to represent a tool consumer user. More...
Public Member Functions | |
| __construct () | |
| Class constructor. More... | |
| initialize () | |
| Initialise the user. More... | |
| initialise () | |
| Initialise the user. More... | |
| save () | |
| Save the user to the database. More... | |
| delete () | |
| Delete the user from the database. More... | |
| getResourceLink () | |
| Get resource link. More... | |
| getRecordId () | |
| Get record ID of user. More... | |
| setRecordId ($id) | |
| Set record ID of user. More... | |
| setResourceLinkId ($resourceLinkId) | |
| Set resource link ID of user. More... | |
| getDataConnector () | |
| Get the data connector. More... | |
| getId ($idScope=null) | |
| Get the user ID (which may be a compound of the tool consumer and resource link IDs). More... | |
| setNames ($firstname, $lastname, $fullname) | |
| Set the user's name. More... | |
| setEmail ($email, $defaultEmail=null) | |
| Set the user's email address. More... | |
| isAdmin () | |
| Check if the user is an administrator (at any of the system, institution or context levels). More... | |
| isStaff () | |
| Check if the user is staff. More... | |
| isLearner () | |
| Check if the user is a learner. More... | |
Static Public Member Functions | |
| static | fromRecordId ($id, $dataConnector) |
| Load the user from the database. More... | |
| static | fromResourceLink ($resourceLink, $ltiUserId) |
| Class constructor from resource link. More... | |
Data Fields | |
| $firstname = '' | |
| User's first name. More... | |
| $lastname = '' | |
| User's last name (surname or family name). More... | |
| $fullname = '' | |
| User's fullname. More... | |
| $email = '' | |
| User's email address. More... | |
| $image = '' | |
| User's image URI. More... | |
| $roles = array() | |
| Roles for user. More... | |
| $groups = array() | |
| Groups for user. More... | |
| $ltiResultSourcedId = null | |
| User's result sourcedid. More... | |
| $created = null | |
| Date/time the record was created. More... | |
| $updated = null | |
| Date/time the record was last updated. More... | |
| $ltiUserId = null | |
| user ID as supplied in the last connection request. More... | |
Class to represent a tool consumer user.
| __construct | ( | ) |
| delete | ( | ) |
Delete the user from the database.
Definition at line 174 of file User.php.
References User\getDataConnector().
|
static |
Load the user from the database.
| int | $id | Record ID of user |
| DataConnector | $dataConnector | Database connection object |
Definition at line 395 of file User.php.
Referenced by DataConnector_pdo\getUserResultSourcedIDsResourceLink().
|
static |
Class constructor from resource link.
| ResourceLink | $resourceLink | Resource_Link object |
| string | $ltiUserId | User ID value |
Definition at line 413 of file User.php.
References User\$ltiUserId, User\getDataConnector(), and User\initialize().
Referenced by ResourceLink\doMembershipsService(), Membership\get(), DataConnector_mysql\getUserResultSourcedIDsResourceLink(), and ToolProvider\onError().
| getDataConnector | ( | ) |
Get the data connector.
Definition at line 240 of file User.php.
Referenced by User\delete(), User\fromResourceLink(), User\getResourceLink(), and User\save().
| getId | ( | $idScope = null | ) |
Get the user ID (which may be a compound of the tool consumer and resource link IDs).
| int | $idScope | Scope to use for user ID (optional, default is null for consumer default setting) |
Definition at line 254 of file User.php.
References User\$ltiUserId, User\getResourceLink(), ToolProvider\ID_SCOPE_CONTEXT, ToolProvider\ID_SCOPE_GLOBAL, ToolProvider\ID_SCOPE_ID_ONLY, ToolProvider\ID_SCOPE_RESOURCE, and ToolProvider\ID_SCOPE_SEPARATOR.
Referenced by User\setEmail().
| getRecordId | ( | ) |
| getResourceLink | ( | ) |
Get resource link.
Definition at line 188 of file User.php.
References ResourceLink\fromRecordId(), and User\getDataConnector().
Referenced by User\getId().
| initialise | ( | ) |
Initialise the user.
Pseudonym for initialize().
Definition at line 144 of file User.php.
References User\initialize().
| initialize | ( | ) |
Initialise the user.
Definition at line 123 of file User.php.
Referenced by User\__construct(), User\fromResourceLink(), and User\initialise().
| isAdmin | ( | ) |
| isLearner | ( | ) |
| isStaff | ( | ) |
| save | ( | ) |
Save the user to the database.
Definition at line 156 of file User.php.
References User\getDataConnector().
| setEmail | ( | $email, | |
$defaultEmail = null |
|||
| ) |
Set the user's email address.
| string | Email address value | |
| string | $defaultEmail | Value to use if no email is provided (optional, default is none) |
Definition at line 334 of file User.php.
References User\$email, and User\getId().
| setNames | ( | $firstname, | |
| $lastname, | |||
| $fullname | |||
| ) |
Set the user's name.
| string | $firstname | User's first name. |
| string | $lastname | User's last name. |
| string | $fullname | User's full name. |
Definition at line 298 of file User.php.
References User\$firstname, User\$fullname, User\$lastname, and User\$ltiUserId.
| setRecordId | ( | $id | ) |
| setResourceLinkId | ( | $resourceLinkId | ) |
| string $email = '' |
| string $firstname = '' |
| string $fullname = '' |
| string $lastname = '' |
User's last name (surname or family name).
Definition at line 29 of file User.php.
Referenced by User\setNames().
| string $ltiUserId = null |
user ID as supplied in the last connection request.
Definition at line 102 of file User.php.
Referenced by User\fromResourceLink(), User\getId(), and User\setNames().
| object $updated = null |