class User

This is a class to provide access to the resource context level data.

This data comes from the LTI launch from the LMS. A context is the equivalent of a "class" or course. A context has a roster of users and each user has a role within the context. A launch may or may not contain a context. If there is a link without a context, it is a "system-wide" link like "view profile" or "show all courses"

Traits

This is a class holding convienence methods to access the json column for the core objects.

Properties

protected $TABLE_NAME
protected $PRIMARY_KEY
protected $ENTITY_NAME
$id The integer primary key for this user in the 'lti_user' table.
$email The user's email
$displayname The user's display name
$firstname The user's first name
$lastname The user's last name
$locale The User's Locale
$image The User's Image / Avatar
$instructor Is the user an instructor?

Methods

string
getJson()

Load the json field for this entity

from JsonTrait
getJsonKey($key, $default = false)

Get a JSON key for this entity

from JsonTrait
setJson($json)

Set the JSON entry for this entity

from JsonTrait
setJsonKey($key, $value)

Set/update a JSON key for this entity

from JsonTrait
setJsonKeys($values)

Set/update an array of JSON keys for this entity

from JsonTrait
getNameAndEmail()

Construct the user's name / email combination

getFirstName($displayname = null)

Get the user's first name, falling back to email

static 
loadUserInfoBypass($user_id)

Load a user's info from the user_id

Details

in JsonTrait at line 21
string getJson()

Load the json field for this entity

Return Value

string This returns the json string - it is not parsed - if there is nothing to return - this returns "false"

in JsonTrait at line 41
getJsonKey($key, $default = false)

Get a JSON key for this entity

Parameters

$key
$default

in JsonTrait at line 58
setJson($json)

Set the JSON entry for this entity

Parameters

$json

in JsonTrait at line 75
setJsonKey($key, $value)

Set/update a JSON key for this entity

Parameters

$key
$value

in JsonTrait at line 93
setJsonKeys($values)

Set/update an array of JSON keys for this entity

Parameters

$values

at line 72
getNameAndEmail()

Construct the user's name / email combination

at line 93
getFirstName($displayname = null)

Get the user's first name, falling back to email

Parameters

$displayname

at line 107
static loadUserInfoBypass($user_id)

Load a user's info from the user_id

We make sure that the user is a member of the current context so as not to slide across silos.

Parameters

$user_id