user extends abstract_moodle_entity
User Entity (Moodle Native).
Table of Contents
Properties
- $address : string
- $alternatename : string|null
- $auth : string
- $autosubscribe : int
- $calendartype : string
- $city : string
- $confirmed : int
- $country : string
- $currentlogin : int
- $deleted : int
- $department : string
- $description : string|null
- $descriptionformat : int
- $email : string
- $emailstop : int
- $firstaccess : int
- $firstname : string
- $firstnamephonetic : string|null
- $id : int
- $idnumber : string
- $imagealt : string|null
- $institution : string
- $lang : string
- $lastaccess : int
- $lastip : string
- $lastlogin : int
- $lastname : string
- $lastnamephonetic : string|null
- $maildigest : int
- $maildisplay : int
- $mailformat : int
- $middlename : string|null
- $mnethostid : int
- $moodlenetprofile : string|null
- $password : string
- $phone1 : string
- $phone2 : string
- $picture : int
- $policyagreed : int
- $secret : string
- $suspended : int
- $theme : string
- $timecreated : int
- $timemodified : int
- $timezone : string
- $trackforums : int
- $trustbitmask : int
- $username : string
Methods
- __call() : mixed
- Magic accessor to support get_* and with_* helpers for entity properties.
- __get() : mixed
- Magic getter to allow reading protected properties.
- __isset() : bool
- Magic isset to allow checking protected properties.
- __set() : void
- Magic setter.
- as_std_class() : stdClass
- Returns the entity as stdClass (alias for to_record).
- from_record() : static
- Factory method to create an entity from a Moodle record.
- get_address() : string
- Get address.
- get_alternatename() : null|string
- Get alternate name.
- get_auth() : string
- Get authentication plugin.
- get_autosubscribe() : int
- Get autosubscribe preference.
- get_calendartype() : string
- Get calendar type.
- get_city() : string
- Get city.
- get_confirmed() : int
- Get confirmation flag.
- get_country() : string
- Get country code.
- get_currentlogin() : int
- Get current login timestamp.
- get_deleted() : int
- Get deleted flag.
- get_department() : string
- Get department.
- get_description() : null|string
- Get description.
- get_descriptionformat() : int
- Get description format.
- get_email() : string
- Get email.
- get_emailstop() : int
- Get email stop flag.
- get_firstaccess() : int
- Get first access timestamp.
- get_firstname() : string
- Get first name.
- get_firstnamephonetic() : null|string
- Get firstname phonetic.
- get_fullname() : string
- Helper to get fullname.
- get_id() : null|int
- Get the entity unique identifier.
- get_idnumber() : string
- Get idnumber.
- get_imagealt() : null|string
- Get image alt text.
- get_institution() : string
- Get institution.
- get_lang() : string
- Get language.
- get_lastaccess() : int
- Get last access timestamp.
- get_lastip() : string
- Get last IP.
- get_lastlogin() : int
- Get last login timestamp.
- get_lastname() : string
- Get last name.
- get_lastnamephonetic() : null|string
- Get lastname phonetic.
- get_maildigest() : int
- Get mail digest mode.
- get_maildisplay() : int
- Get mail display preference.
- get_mailformat() : int
- Get mail format.
- get_middlename() : null|string
- Get middle name.
- get_mnethostid() : int
- Get MNet host identifier.
- get_moodlenetprofile() : null|string
- Get MoodleNet profile.
- get_password() : string
- Get hashed password.
- get_phone1() : string
- Get primary phone.
- get_phone2() : string
- Get secondary phone.
- get_picture() : int
- Get picture revision.
- get_policyagreed() : int
- Get policy agreement flag.
- get_secret() : string
- Get secret string.
- get_suspended() : int
- Get suspended flag.
- get_table() : string
- Returns the Moodle database table name.
- get_theme() : string
- Get theme.
- get_timecreated() : int
- Get entity creation timestamp.
- get_timemodified() : int
- Get entity modification timestamp.
- get_timezone() : string
- Get timezone.
- get_trackforums() : int
- Get forums tracking preference.
- get_trustbitmask() : int
- Get trust bitmask.
- get_username() : string
- Get username.
- jsonSerialize() : array<string, mixed>
- Serializes the object to a value that can be natively serialized by json_encode().
- to_array() : array<string, mixed>
- Implementation for entity_interface.
- to_record() : stdClass
- Converts the entity to a stdClass record for Moodle APIs.
- with_address() : $this
- Set address.
- with_alternatename() : $this
- Set alternate name.
- with_auth() : $this
- Set authentication plugin.
- with_autosubscribe() : $this
- Set autosubscribe preference.
- with_calendartype() : $this
- Set calendar type.
- with_city() : $this
- Set city.
- with_confirmed() : $this
- Set confirmation flag.
- with_country() : $this
- Set country code.
- with_currentlogin() : $this
- Set current login timestamp.
- with_deleted() : $this
- Set deleted flag.
- with_department() : $this
- Set department.
- with_description() : $this
- Set description.
- with_descriptionformat() : $this
- Set description format.
- with_email() : $this
- Set email.
- with_emailstop() : $this
- Set email stop flag.
- with_firstaccess() : $this
- Set first access timestamp.
- with_firstname() : $this
- Set first name.
- with_firstnamephonetic() : $this
- Set firstname phonetic.
- with_id() : $this
- Set entity identifier.
- with_idnumber() : $this
- Set idnumber.
- with_imagealt() : $this
- Set image alt text.
- with_institution() : $this
- Set institution.
- with_lang() : $this
- Set language.
- with_lastaccess() : $this
- Set last access timestamp.
- with_lastip() : $this
- Set last IP.
- with_lastlogin() : $this
- Set last login timestamp.
- with_lastname() : $this
- Set last name.
- with_lastnamephonetic() : $this
- Set lastname phonetic.
- with_maildigest() : $this
- Set mail digest mode.
- with_maildisplay() : $this
- Set mail display preference.
- with_mailformat() : $this
- Set mail format.
- with_middlename() : $this
- Set middle name.
- with_mnethostid() : $this
- Set MNet host identifier.
- with_moodlenetprofile() : $this
- Set MoodleNet profile.
- with_password() : $this
- Set hashed password.
- with_phone1() : $this
- Set primary phone.
- with_phone2() : $this
- Set secondary phone.
- with_picture() : $this
- Set picture revision.
- with_policyagreed() : $this
- Set policy agreement flag.
- with_secret() : $this
- Set secret string.
- with_suspended() : $this
- Set suspended flag.
- with_theme() : $this
- Set theme.
- with_timecreated() : $this
- Set entity creation timestamp.
- with_timemodified() : $this
- Set entity modification timestamp.
- with_timezone() : $this
- Set timezone.
- with_trackforums() : $this
- Set forums tracking preference.
- with_trustbitmask() : $this
- Set trust bitmask.
- with_username() : $this
- Set username.
Properties
$address
protected
string
$address
= ''
$alternatename
protected
string|null
$alternatename
= null
$auth
protected
string
$auth
= 'manual'
$autosubscribe
protected
int
$autosubscribe
= 1
$calendartype
protected
string
$calendartype
= 'gregorian'
$city
protected
string
$city
= ''
$confirmed
protected
int
$confirmed
= 0
$country
protected
string
$country
= ''
$currentlogin
protected
int
$currentlogin
= 0
$deleted
protected
int
$deleted
= 0
$department
protected
string
$department
= ''
$description
protected
string|null
$description
= null
$descriptionformat
protected
int
$descriptionformat
= 1
protected
string
$email
= ''
$emailstop
protected
int
$emailstop
= 0
$firstaccess
protected
int
$firstaccess
= 0
$firstname
protected
string
$firstname
= ''
$firstnamephonetic
protected
string|null
$firstnamephonetic
= null
$id
protected
int
$id
= 0
$idnumber
protected
string
$idnumber
= ''
$imagealt
protected
string|null
$imagealt
= null
$institution
protected
string
$institution
= ''
$lang
protected
string
$lang
= 'en'
$lastaccess
protected
int
$lastaccess
= 0
$lastip
protected
string
$lastip
= ''
$lastlogin
protected
int
$lastlogin
= 0
$lastname
protected
string
$lastname
= ''
$lastnamephonetic
protected
string|null
$lastnamephonetic
= null
$maildigest
protected
int
$maildigest
= 0
$maildisplay
protected
int
$maildisplay
= 2
$mailformat
protected
int
$mailformat
= 1
$middlename
protected
string|null
$middlename
= null
$mnethostid
protected
int
$mnethostid
= 0
$moodlenetprofile
protected
string|null
$moodlenetprofile
= null
$password
protected
string
$password
= ''
$phone1
protected
string
$phone1
= ''
$phone2
protected
string
$phone2
= ''
$picture
protected
int
$picture
= 0
$policyagreed
protected
int
$policyagreed
= 0
$secret
protected
string
$secret
= ''
$suspended
protected
int
$suspended
= 0
$theme
protected
string
$theme
= ''
$timecreated
protected
int
$timecreated
= 0
$timemodified
protected
int
$timemodified
= 0
$timezone
protected
string
$timezone
= '99'
$trackforums
protected
int
$trackforums
= 0
$trustbitmask
protected
int
$trustbitmask
= 0
$username
protected
string
$username
= ''
Methods
__call()
Magic accessor to support get_* and with_* helpers for entity properties.
public
__call(string $name, array<string|int, mixed> $arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
__get()
Magic getter to allow reading protected properties.
public
__get(string $name) : mixed
Parameters
- $name : string
-
Property name
__isset()
Magic isset to allow checking protected properties.
public
__isset(string $name) : bool
Parameters
- $name : string
-
Property name
Return values
bool__set()
Magic setter.
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
-
Property name
- $value : mixed
-
Value
as_std_class()
Returns the entity as stdClass (alias for to_record).
public
as_std_class() : stdClass
Return values
stdClassfrom_record()
Factory method to create an entity from a Moodle record.
public
static from_record(array<string|int, mixed>|stdClass $record) : static
Automatically casts values to match property types (int, string, etc.) since Moodle's database layer often returns numeric values as strings.
Parameters
- $record : array<string|int, mixed>|stdClass
Return values
staticget_address()
Get address.
public
get_address() : string
Return values
stringget_alternatename()
Get alternate name.
public
get_alternatename() : null|string
Return values
null|stringget_auth()
Get authentication plugin.
public
get_auth() : string
Return values
stringget_autosubscribe()
Get autosubscribe preference.
public
get_autosubscribe() : int
Return values
intget_calendartype()
Get calendar type.
public
get_calendartype() : string
Return values
stringget_city()
Get city.
public
get_city() : string
Return values
stringget_confirmed()
Get confirmation flag.
public
get_confirmed() : int
Return values
intget_country()
Get country code.
public
get_country() : string
Return values
stringget_currentlogin()
Get current login timestamp.
public
get_currentlogin() : int
Return values
intget_deleted()
Get deleted flag.
public
get_deleted() : int
Return values
intget_department()
Get department.
public
get_department() : string
Return values
stringget_description()
Get description.
public
get_description() : null|string
Return values
null|stringget_descriptionformat()
Get description format.
public
get_descriptionformat() : int
Return values
intget_email()
Get email.
public
get_email() : string
Return values
stringget_emailstop()
Get email stop flag.
public
get_emailstop() : int
Return values
intget_firstaccess()
Get first access timestamp.
public
get_firstaccess() : int
Return values
intget_firstname()
Get first name.
public
get_firstname() : string
Return values
stringget_firstnamephonetic()
Get firstname phonetic.
public
get_firstnamephonetic() : null|string
Return values
null|stringget_fullname()
Helper to get fullname.
public
get_fullname() : string
Return values
stringget_id()
Get the entity unique identifier.
public
get_id() : null|int
Return values
null|intget_idnumber()
Get idnumber.
public
get_idnumber() : string
Return values
stringget_imagealt()
Get image alt text.
public
get_imagealt() : null|string
Return values
null|stringget_institution()
Get institution.
public
get_institution() : string
Return values
stringget_lang()
Get language.
public
get_lang() : string
Return values
stringget_lastaccess()
Get last access timestamp.
public
get_lastaccess() : int
Return values
intget_lastip()
Get last IP.
public
get_lastip() : string
Return values
stringget_lastlogin()
Get last login timestamp.
public
get_lastlogin() : int
Return values
intget_lastname()
Get last name.
public
get_lastname() : string
Return values
stringget_lastnamephonetic()
Get lastname phonetic.
public
get_lastnamephonetic() : null|string
Return values
null|stringget_maildigest()
Get mail digest mode.
public
get_maildigest() : int
Return values
intget_maildisplay()
Get mail display preference.
public
get_maildisplay() : int
Return values
intget_mailformat()
Get mail format.
public
get_mailformat() : int
Return values
intget_middlename()
Get middle name.
public
get_middlename() : null|string
Return values
null|stringget_mnethostid()
Get MNet host identifier.
public
get_mnethostid() : int
Return values
intget_moodlenetprofile()
Get MoodleNet profile.
public
get_moodlenetprofile() : null|string
Return values
null|stringget_password()
Get hashed password.
public
get_password() : string
Return values
stringget_phone1()
Get primary phone.
public
get_phone1() : string
Return values
stringget_phone2()
Get secondary phone.
public
get_phone2() : string
Return values
stringget_picture()
Get picture revision.
public
get_picture() : int
Return values
intget_policyagreed()
Get policy agreement flag.
public
get_policyagreed() : int
Return values
intget_secret()
Get secret string.
public
get_secret() : string
Return values
stringget_suspended()
Get suspended flag.
public
get_suspended() : int
Return values
intget_table()
Returns the Moodle database table name.
public
static get_table() : string
Return values
stringget_theme()
Get theme.
public
get_theme() : string
Return values
stringget_timecreated()
Get entity creation timestamp.
public
get_timecreated() : int
Return values
intget_timemodified()
Get entity modification timestamp.
public
get_timemodified() : int
Return values
intget_timezone()
Get timezone.
public
get_timezone() : string
Return values
stringget_trackforums()
Get forums tracking preference.
public
get_trackforums() : int
Return values
intget_trustbitmask()
Get trust bitmask.
public
get_trustbitmask() : int
Return values
intget_username()
Get username.
public
get_username() : string
Return values
stringjsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
public
jsonSerialize() : array<string, mixed>
Tags
Return values
array<string, mixed>to_array()
Implementation for entity_interface.
public
to_array() : array<string, mixed>
Return values
array<string, mixed>to_record()
Converts the entity to a stdClass record for Moodle APIs.
public
to_record() : stdClass
Return values
stdClasswith_address()
Set address.
public
with_address(string $address) : $this
Parameters
- $address : string
Return values
$thiswith_alternatename()
Set alternate name.
public
with_alternatename(null|string $alternatename) : $this
Parameters
- $alternatename : null|string
Return values
$thiswith_auth()
Set authentication plugin.
public
with_auth(string $auth) : $this
Parameters
- $auth : string
Return values
$thiswith_autosubscribe()
Set autosubscribe preference.
public
with_autosubscribe(int $autosubscribe) : $this
Parameters
- $autosubscribe : int
Return values
$thiswith_calendartype()
Set calendar type.
public
with_calendartype(string $calendartype) : $this
Parameters
- $calendartype : string
Return values
$thiswith_city()
Set city.
public
with_city(string $city) : $this
Parameters
- $city : string
Return values
$thiswith_confirmed()
Set confirmation flag.
public
with_confirmed(int $confirmed) : $this
Parameters
- $confirmed : int
Return values
$thiswith_country()
Set country code.
public
with_country(string $country) : $this
Parameters
- $country : string
Return values
$thiswith_currentlogin()
Set current login timestamp.
public
with_currentlogin(int $currentlogin) : $this
Parameters
- $currentlogin : int
Return values
$thiswith_deleted()
Set deleted flag.
public
with_deleted(int $deleted) : $this
Parameters
- $deleted : int
Return values
$thiswith_department()
Set department.
public
with_department(string $department) : $this
Parameters
- $department : string
Return values
$thiswith_description()
Set description.
public
with_description(null|string $description) : $this
Parameters
- $description : null|string
Return values
$thiswith_descriptionformat()
Set description format.
public
with_descriptionformat(int $descriptionformat) : $this
Parameters
- $descriptionformat : int
Return values
$thiswith_email()
Set email.
public
with_email(string $email) : $this
Parameters
- $email : string
Return values
$thiswith_emailstop()
Set email stop flag.
public
with_emailstop(int $emailstop) : $this
Parameters
- $emailstop : int
Return values
$thiswith_firstaccess()
Set first access timestamp.
public
with_firstaccess(int $firstaccess) : $this
Parameters
- $firstaccess : int
Return values
$thiswith_firstname()
Set first name.
public
with_firstname(string $firstname) : $this
Parameters
- $firstname : string
Return values
$thiswith_firstnamephonetic()
Set firstname phonetic.
public
with_firstnamephonetic(null|string $firstnamephonetic) : $this
Parameters
- $firstnamephonetic : null|string
Return values
$thiswith_id()
Set entity identifier.
public
with_id(null|int $id) : $this
Parameters
- $id : null|int
Return values
$thiswith_idnumber()
Set idnumber.
public
with_idnumber(string $idnumber) : $this
Parameters
- $idnumber : string
Return values
$thiswith_imagealt()
Set image alt text.
public
with_imagealt(null|string $imagealt) : $this
Parameters
- $imagealt : null|string
Return values
$thiswith_institution()
Set institution.
public
with_institution(string $institution) : $this
Parameters
- $institution : string
Return values
$thiswith_lang()
Set language.
public
with_lang(string $lang) : $this
Parameters
- $lang : string
Return values
$thiswith_lastaccess()
Set last access timestamp.
public
with_lastaccess(int $lastaccess) : $this
Parameters
- $lastaccess : int
Return values
$thiswith_lastip()
Set last IP.
public
with_lastip(string $lastip) : $this
Parameters
- $lastip : string
Return values
$thiswith_lastlogin()
Set last login timestamp.
public
with_lastlogin(int $lastlogin) : $this
Parameters
- $lastlogin : int
Return values
$thiswith_lastname()
Set last name.
public
with_lastname(string $lastname) : $this
Parameters
- $lastname : string
Return values
$thiswith_lastnamephonetic()
Set lastname phonetic.
public
with_lastnamephonetic(null|string $lastnamephonetic) : $this
Parameters
- $lastnamephonetic : null|string
Return values
$thiswith_maildigest()
Set mail digest mode.
public
with_maildigest(int $maildigest) : $this
Parameters
- $maildigest : int
Return values
$thiswith_maildisplay()
Set mail display preference.
public
with_maildisplay(int $maildisplay) : $this
Parameters
- $maildisplay : int
Return values
$thiswith_mailformat()
Set mail format.
public
with_mailformat(int $mailformat) : $this
Parameters
- $mailformat : int
Return values
$thiswith_middlename()
Set middle name.
public
with_middlename(null|string $middlename) : $this
Parameters
- $middlename : null|string
Return values
$thiswith_mnethostid()
Set MNet host identifier.
public
with_mnethostid(int $mnethostid) : $this
Parameters
- $mnethostid : int
Return values
$thiswith_moodlenetprofile()
Set MoodleNet profile.
public
with_moodlenetprofile(null|string $moodlenetprofile) : $this
Parameters
- $moodlenetprofile : null|string
Return values
$thiswith_password()
Set hashed password.
public
with_password(string $password) : $this
Parameters
- $password : string
Return values
$thiswith_phone1()
Set primary phone.
public
with_phone1(string $phone1) : $this
Parameters
- $phone1 : string
Return values
$thiswith_phone2()
Set secondary phone.
public
with_phone2(string $phone2) : $this
Parameters
- $phone2 : string
Return values
$thiswith_picture()
Set picture revision.
public
with_picture(int $picture) : $this
Parameters
- $picture : int
Return values
$thiswith_policyagreed()
Set policy agreement flag.
public
with_policyagreed(int $policyagreed) : $this
Parameters
- $policyagreed : int
Return values
$thiswith_secret()
Set secret string.
public
with_secret(string $secret) : $this
Parameters
- $secret : string
Return values
$thiswith_suspended()
Set suspended flag.
public
with_suspended(int $suspended) : $this
Parameters
- $suspended : int
Return values
$thiswith_theme()
Set theme.
public
with_theme(string $theme) : $this
Parameters
- $theme : string
Return values
$thiswith_timecreated()
Set entity creation timestamp.
public
with_timecreated(int $timecreated) : $this
Parameters
- $timecreated : int
Return values
$thiswith_timemodified()
Set entity modification timestamp.
public
with_timemodified(int $timemodified) : $this
Parameters
- $timemodified : int
Return values
$thiswith_timezone()
Set timezone.
public
with_timezone(string $timezone) : $this
Parameters
- $timezone : string
Return values
$thiswith_trackforums()
Set forums tracking preference.
public
with_trackforums(int $trackforums) : $this
Parameters
- $trackforums : int
Return values
$thiswith_trustbitmask()
Set trust bitmask.
public
with_trustbitmask(int $trustbitmask) : $this
Parameters
- $trustbitmask : int
Return values
$thiswith_username()
Set username.
public
with_username(string $username) : $this
Parameters
- $username : string