Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
enrol_lti\local\ltiadvantage\entity\user Class Reference

Public Member Functions

 get_city ()
 Get the user's city.
 
 get_country ()
 Get the user's country code.
 
 get_deploymentid ()
 Get the id of the deployment instance to which this user belongs.
 
 get_id ()
 Get the id of this user instance.
 
 get_institution ()
 Get the instituation of the user.
 
 get_lang ()
 Get the lang code of the user.
 
 get_lastaccess ()
 Get the last access timestamp for this user.
 
 get_lastgrade ()
 Get the last grade value for this user.
 
 get_localid ()
 Get the id of the user in the tool.
 
 get_maildisplay ()
 Get the maildisplay of the user.
 
 get_resourceid ()
 Get the id of the published resource to which this user is associated.
 
 get_resourcelinkid ()
 Get the id of the resource_link instance to which this user is associated.
 
 get_sourceid ()
 Get the id of the user in the platform.
 
 get_timezone ()
 Get the timezone of the user.
 
 set_city (string $city)
 Set the user's city.
 
 set_country (string $countrycode)
 Set the user's country.
 
 set_institution (string $institution)
 Set the user's institution.
 
 set_lang (string $langcode)
 Set the user's language.
 
 set_lastaccess (int $time)
 Set the last access time for the user.
 
 set_lastgrade (float $lastgrade)
 Set the last grade for the user.
 
 set_maildisplay (int $maildisplay)
 Set the user's mail display preference from a range of supported options.
 
 set_resourcelinkid (int $resourcelinkid)
 Associate this user with the given resource_link instance, denoting that this user launched from the instance.
 
 set_timezone (string $timezone)
 Set the user's timezone, or set '99' to specify server timezone.
 

Static Public Member Functions

static create (int $resourceid, int $userid, int $deploymentid, string $sourceid, string $lang, string $timezone, string $city='', string $country='', string $institution='', ?int $maildisplay=null, ?float $lastgrade=null, ?int $lastaccess=null, ?int $resourcelinkid=null, int $id=null)
 Factory method for creating a user.
 
static create_from_resource_link (int $resourcelinkid, int $resourceid, int $userid, int $deploymentid, string $sourceid, string $lang, string $timezone, string $city='', string $country='', string $institution='', ?int $maildisplay=null)
 Factory method for creating a user instance associated with a given resource_link instance.
 

Member Function Documentation

◆ create()

static enrol_lti\local\ltiadvantage\entity\user::create ( int $resourceid,
int $userid,
int $deploymentid,
string $sourceid,
string $lang,
string $timezone,
string $city = '',
string $country = '',
string $institution = '',
?int $maildisplay = null,
?float $lastgrade = null,
?int $lastaccess = null,
?int $resourcelinkid = null,
int $id = null )
static

Factory method for creating a user.

Parameters
int$resourceidthe id of the published resource to which this user belongs.
int$useridthe id of the Moodle user to which this LTI user relates.
int$deploymentidthe local id of the deployment instance to which this user belongs.
string$sourceidthe id of the user in the platform site.
string$langthe user's language code.
string$timezonethe user's timezone.
string$citythe user's city.
string$countrythe user's country.
string$institutionthe user's institution.
int | null$maildisplaythe user's maildisplay, or null to select defaults.
float | null$lastgradethe user's last grade value.
int | null$lastaccessthe user's last access time, or null if they haven't accessed the resource.
int | null$resourcelinkidthe local id of the resource link instance associated with the user.
int | null$idthe id of this lti user instance, or null if it's a not-yet-persisted object.
Return values
userthe user instance.

◆ create_from_resource_link()

static enrol_lti\local\ltiadvantage\entity\user::create_from_resource_link ( int $resourcelinkid,
int $resourceid,
int $userid,
int $deploymentid,
string $sourceid,
string $lang,
string $timezone,
string $city = '',
string $country = '',
string $institution = '',
?int $maildisplay = null )
static

Factory method for creating a user instance associated with a given resource_link instance.

Parameters
int$resourcelinkidthe local id of the resource link instance to link to the user.
int$resourceidthe id of the published resource to which this user belongs.
int$useridthe id of the Moodle user to which this LTI user relates.
int$deploymentidthe local id of the deployment instance to which this user belongs.
string$sourceidthe id of the user in the platform site.
string$langthe user's language code.
string$timezonethe user's timezone.
string$citythe user's city.
string$countrythe user's country.
string$institutionthe user's institution.
int | null$maildisplaythe user's maildisplay, or null to select defaults.
Return values
userthe user instance.

◆ get_city()

enrol_lti\local\ltiadvantage\entity\user::get_city ( )

Get the user's city.

Return values
stringthe city.

◆ get_country()

enrol_lti\local\ltiadvantage\entity\user::get_country ( )

Get the user's country code.

Return values
stringthe country code.

◆ get_deploymentid()

enrol_lti\local\ltiadvantage\entity\user::get_deploymentid ( )

Get the id of the deployment instance to which this user belongs.

Return values
intid of the deployment instance.

◆ get_id()

enrol_lti\local\ltiadvantage\entity\user::get_id ( )

Get the id of this user instance.

Return values
int|nullthe object id, or null if not yet persisted.

◆ get_institution()

enrol_lti\local\ltiadvantage\entity\user::get_institution ( )

Get the instituation of the user.

Return values
stringthe institution.

◆ get_lang()

enrol_lti\local\ltiadvantage\entity\user::get_lang ( )

Get the lang code of the user.

Return values
stringthe user's language code.

◆ get_lastaccess()

enrol_lti\local\ltiadvantage\entity\user::get_lastaccess ( )

Get the last access timestamp for this user.

Return values
int|nullthe last access timestampt, or null if the user hasn't accessed the resource.

◆ get_lastgrade()

enrol_lti\local\ltiadvantage\entity\user::get_lastgrade ( )

Get the last grade value for this user.

Return values
floatthe float grade.

◆ get_localid()

enrol_lti\local\ltiadvantage\entity\user::get_localid ( )

Get the id of the user in the tool.

Return values
int|nullthe id, or null if the object instance hasn't yet been persisted.

◆ get_maildisplay()

enrol_lti\local\ltiadvantage\entity\user::get_maildisplay ( )

Get the maildisplay of the user.

Return values
intthe maildisplay.

◆ get_resourceid()

enrol_lti\local\ltiadvantage\entity\user::get_resourceid ( )

Get the id of the published resource to which this user is associated.

Return values
intthe resource id.

◆ get_resourcelinkid()

enrol_lti\local\ltiadvantage\entity\user::get_resourcelinkid ( )

Get the id of the resource_link instance to which this user is associated.

Return values
int|nullthe object id, or null if the user isn't associated with one.

◆ get_sourceid()

enrol_lti\local\ltiadvantage\entity\user::get_sourceid ( )

Get the id of the user in the platform.

Return values
stringthe source id.

◆ get_timezone()

enrol_lti\local\ltiadvantage\entity\user::get_timezone ( )

Get the timezone of the user.

Return values
stringthe user timezone.

◆ set_city()

enrol_lti\local\ltiadvantage\entity\user::set_city ( string $city)

Set the user's city.

Parameters
string$citythe city string.

◆ set_country()

enrol_lti\local\ltiadvantage\entity\user::set_country ( string $countrycode)

Set the user's country.

Parameters
string$countrycodethe 2 digit country code representing the country, or '' to denote none.

◆ set_institution()

enrol_lti\local\ltiadvantage\entity\user::set_institution ( string $institution)

Set the user's institution.

Parameters
string$institutionthe name of the institution.

◆ set_lang()

enrol_lti\local\ltiadvantage\entity\user::set_lang ( string $langcode)

Set the user's language.

Parameters
string$langcodethe language code representing the user's language.

◆ set_lastaccess()

enrol_lti\local\ltiadvantage\entity\user::set_lastaccess ( int $time)

Set the last access time for the user.

Parameters
int$timeunix timestamp representing the last time the user accessed the published resource.
Exceptions
coding_exceptionif $time is not a positive int.

◆ set_lastgrade()

enrol_lti\local\ltiadvantage\entity\user::set_lastgrade ( float $lastgrade)

Set the last grade for the user.

Parameters
float$lastgradethe last grade the user received.

◆ set_maildisplay()

enrol_lti\local\ltiadvantage\entity\user::set_maildisplay ( int $maildisplay)

Set the user's mail display preference from a range of supported options.

0 - hide from non privileged users 1 - allow everyone to see 2 - allow only course participants to see

Parameters
int$maildisplaythe maildisplay preference to set.

◆ set_resourcelinkid()

enrol_lti\local\ltiadvantage\entity\user::set_resourcelinkid ( int $resourcelinkid)

Associate this user with the given resource_link instance, denoting that this user launched from the instance.

Parameters
int$resourcelinkidthe id of the resource_link instance.

◆ set_timezone()

enrol_lti\local\ltiadvantage\entity\user::set_timezone ( string $timezone)

Set the user's timezone, or set '99' to specify server timezone.

Parameters
string$timezonethe timezone string, or '99' to use server timezone.

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