user
class user extends abstract_moodle_entity
User Entity (Moodle Native).
Properties
| protected int | $id | from abstract_moodle_entity | |
| protected int | $timecreated | from abstract_moodle_entity | |
| protected int | $timemodified | from abstract_moodle_entity | |
| protected string | $auth | ||
| protected int | $confirmed | ||
| protected int | $policyagreed | ||
| protected int | $deleted | ||
| protected int | $suspended | ||
| protected int | $mnethostid | ||
| protected string | $username | ||
| protected string | $password | ||
| protected string | $idnumber | ||
| protected string | $firstname | ||
| protected string | $lastname | ||
| protected string | |||
| protected int | $emailstop | ||
| protected string | $phone1 | ||
| protected string | $phone2 | ||
| protected string | $institution | ||
| protected string | $department | ||
| protected string | $address | ||
| protected string | $city | ||
| protected string | $country | ||
| protected string | $lang | ||
| protected string | $calendartype | ||
| protected string | $theme | ||
| protected string | $timezone | ||
| protected int | $firstaccess | ||
| protected int | $lastaccess | ||
| protected int | $lastlogin | ||
| protected int | $currentlogin | ||
| protected string | $lastip | ||
| protected string | $secret | ||
| protected int | $picture | ||
| protected string|null | $description | ||
| protected int | $descriptionformat | ||
| protected int | $mailformat | ||
| protected int | $maildigest | ||
| protected int | $maildisplay | ||
| protected int | $autosubscribe | ||
| protected int | $trackforums | ||
| protected int | $trustbitmask | ||
| protected string|null | $imagealt | ||
| protected string|null | $lastnamephonetic | ||
| protected string|null | $firstnamephonetic | ||
| protected string|null | $middlename | ||
| protected string|null | $alternatename | ||
| protected string|null | $moodlenetprofile |
Methods
Serializes the object to a value that can be natively serialized by json_encode().
Magic accessor to support get* and with* helpers for entity properties.
Returns the Moodle database table name.
Factory method to create an entity from a Moodle record.
Converts the entity to a stdClass record for Moodle APIs.
Returns the entity as stdClass (alias for to_record).
Set entity creation timestamp.
Set entity modification timestamp.
Helper to get fullname.
Get authentication plugin.
Get confirmation flag.
Set confirmation flag.
Get policy agreement flag.
Set policy agreement flag.
Get deleted flag.
Set deleted flag.
Get suspended flag.
Set suspended flag.
Get MNet host identifier.
Set MNet host identifier.
Get username.
Set username.
Get hashed password.
Set hashed password.
Get idnumber.
Set idnumber.
Get first name.
Set first name.
Get last name.
Set last name.
Get email.
Set email.
Get email stop flag.
Set email stop flag.
Get primary phone.
Set primary phone.
Get secondary phone.
Set secondary phone.
Get institution.
Set institution.
Get department.
Set department.
Get address.
Set address.
Get city.
Get country code.
Set country code.
Get language.
Get calendar type.
Set calendar type.
Get theme.
Set theme.
Get timezone.
Set timezone.
Get first access timestamp.
Set first access timestamp.
Get last access timestamp.
Set last access timestamp.
Get last login timestamp.
Set last login timestamp.
Get current login timestamp.
Set current login timestamp.
Get last IP.
Set last IP.
Get secret string.
Set secret string.
Get picture revision.
Set picture revision.
Get description.
Set description.
Get description format.
Set description format.
Get mail format.
Set mail format.
Get mail digest mode.
Set mail digest mode.
Get mail display preference.
Set mail display preference.
Get autosubscribe preference.
Set autosubscribe preference.
Get forums tracking preference.
Set forums tracking preference.
Get trust bitmask.
Set trust bitmask.
Get image alt text.
Set image alt text.
Get lastname phonetic.
Set lastname phonetic.
Get firstname phonetic.
Set firstname phonetic.
Get middle name.
Set middle name.
Get alternate name.
Set alternate name.
Get MoodleNet profile.
Set MoodleNet profile.
Details
in
abstract_entity at line 37
mixed
__get(string $name)
Magic getter to allow reading protected properties.
in
abstract_entity at line 53
bool
__isset(string $name)
Magic isset to allow checking protected properties.
in
abstract_entity at line 64
void
__set(string $name, mixed $value)
Magic setter.
in
abstract_entity at line 78
array
jsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
in
abstract_moodle_entity at line 47
mixed
__call(string $name, array $arguments)
Magic accessor to support get* and with* helpers for entity properties.
at line 118
static string
get_table()
Returns the Moodle database table name.
in
abstract_moodle_entity at line 94
static abstract_moodle_entity
from_record(array|stdClass $record)
Factory method to create an entity from a Moodle record.
Automatically casts values to match property types (int, string, etc.) since Moodle's database layer often returns numeric values as strings.
in
abstract_moodle_entity at line 117
stdClass
to_record()
Converts the entity to a stdClass record for Moodle APIs.
in
abstract_moodle_entity at line 133
stdClass
as_std_class()
Returns the entity as stdClass (alias for to_record).
in
abstract_moodle_entity at line 143
int|null
get_id()
Get the entity unique identifier.
in
abstract_moodle_entity at line 155
abstract_moodle_entity
with_id(int|null $id)
Set entity identifier.
in
abstract_moodle_entity at line 167
int
get_timecreated()
Get entity creation timestamp.
in
abstract_moodle_entity at line 179
abstract_moodle_entity
with_timecreated(int $timecreated)
Set entity creation timestamp.
in
abstract_moodle_entity at line 191
int
get_timemodified()
Get entity modification timestamp.
in
abstract_moodle_entity at line 203
abstract_moodle_entity
with_timemodified(int $timemodified)
Set entity modification timestamp.
in
abstract_moodle_entity at line 215
array
to_array()
Implementation for entity_interface.
at line 128
string
get_fullname()
Helper to get fullname.
at line 138
string
get_auth()
Get authentication plugin.
at line 150
user
with_auth(string $auth)
Set authentication plugin.
at line 162
int
get_confirmed()
Get confirmation flag.
at line 174
user
with_confirmed(int $confirmed)
Set confirmation flag.
at line 186
int
get_policyagreed()
Get policy agreement flag.
at line 198
user
with_policyagreed(int $policyagreed)
Set policy agreement flag.
at line 210
int
get_deleted()
Get deleted flag.
at line 222
user
with_deleted(int $deleted)
Set deleted flag.
at line 234
int
get_suspended()
Get suspended flag.
at line 246
user
with_suspended(int $suspended)
Set suspended flag.
at line 258
int
get_mnethostid()
Get MNet host identifier.
at line 270
user
with_mnethostid(int $mnethostid)
Set MNet host identifier.
at line 282
string
get_username()
Get username.
at line 294
user
with_username(string $username)
Set username.
at line 306
string
get_password()
Get hashed password.
at line 318
user
with_password(string $password)
Set hashed password.
at line 330
string
get_idnumber()
Get idnumber.
at line 342
user
with_idnumber(string $idnumber)
Set idnumber.
at line 354
string
get_firstname()
Get first name.
at line 366
user
with_firstname(string $firstname)
Set first name.
at line 378
string
get_lastname()
Get last name.
at line 390
user
with_lastname(string $lastname)
Set last name.
at line 402
string
get_email()
Get email.
at line 414
user
with_email(string $email)
Set email.
at line 426
int
get_emailstop()
Get email stop flag.
at line 438
user
with_emailstop(int $emailstop)
Set email stop flag.
at line 450
string
get_phone1()
Get primary phone.
at line 462
user
with_phone1(string $phone1)
Set primary phone.
at line 474
string
get_phone2()
Get secondary phone.
at line 486
user
with_phone2(string $phone2)
Set secondary phone.
at line 498
string
get_institution()
Get institution.
at line 510
user
with_institution(string $institution)
Set institution.
at line 522
string
get_department()
Get department.
at line 534
user
with_department(string $department)
Set department.
at line 546
string
get_address()
Get address.
at line 558
user
with_address(string $address)
Set address.
at line 570
string
get_city()
Get city.
at line 582
user
with_city(string $city)
Set city.
at line 594
string
get_country()
Get country code.
at line 606
user
with_country(string $country)
Set country code.
at line 618
string
get_lang()
Get language.
at line 630
user
with_lang(string $lang)
Set language.
at line 642
string
get_calendartype()
Get calendar type.
at line 654
user
with_calendartype(string $calendartype)
Set calendar type.
at line 666
string
get_theme()
Get theme.
at line 678
user
with_theme(string $theme)
Set theme.
at line 690
string
get_timezone()
Get timezone.
at line 702
user
with_timezone(string $timezone)
Set timezone.
at line 714
int
get_firstaccess()
Get first access timestamp.
at line 726
user
with_firstaccess(int $firstaccess)
Set first access timestamp.
at line 738
int
get_lastaccess()
Get last access timestamp.
at line 750
user
with_lastaccess(int $lastaccess)
Set last access timestamp.
at line 762
int
get_lastlogin()
Get last login timestamp.
at line 774
user
with_lastlogin(int $lastlogin)
Set last login timestamp.
at line 786
int
get_currentlogin()
Get current login timestamp.
at line 798
user
with_currentlogin(int $currentlogin)
Set current login timestamp.
at line 810
string
get_lastip()
Get last IP.
at line 822
user
with_lastip(string $lastip)
Set last IP.
at line 834
string
get_secret()
Get secret string.
at line 846
user
with_secret(string $secret)
Set secret string.
at line 858
int
get_picture()
Get picture revision.
at line 870
user
with_picture(int $picture)
Set picture revision.
at line 882
string|null
get_description()
Get description.
at line 894
user
with_description(string|null $description)
Set description.
at line 906
int
get_descriptionformat()
Get description format.
at line 918
user
with_descriptionformat(int $descriptionformat)
Set description format.
at line 930
int
get_mailformat()
Get mail format.
at line 942
user
with_mailformat(int $mailformat)
Set mail format.
at line 954
int
get_maildigest()
Get mail digest mode.
at line 966
user
with_maildigest(int $maildigest)
Set mail digest mode.
at line 978
int
get_maildisplay()
Get mail display preference.
at line 990
user
with_maildisplay(int $maildisplay)
Set mail display preference.
at line 1002
int
get_autosubscribe()
Get autosubscribe preference.
at line 1014
user
with_autosubscribe(int $autosubscribe)
Set autosubscribe preference.
at line 1026
int
get_trackforums()
Get forums tracking preference.
at line 1038
user
with_trackforums(int $trackforums)
Set forums tracking preference.
at line 1050
int
get_trustbitmask()
Get trust bitmask.
at line 1062
user
with_trustbitmask(int $trustbitmask)
Set trust bitmask.
at line 1074
string|null
get_imagealt()
Get image alt text.
at line 1086
user
with_imagealt(string|null $imagealt)
Set image alt text.
at line 1098
string|null
get_lastnamephonetic()
Get lastname phonetic.
at line 1110
user
with_lastnamephonetic(string|null $lastnamephonetic)
Set lastname phonetic.
at line 1122
string|null
get_firstnamephonetic()
Get firstname phonetic.
at line 1134
user
with_firstnamephonetic(string|null $firstnamephonetic)
Set firstname phonetic.
at line 1146
string|null
get_middlename()
Get middle name.
at line 1158
user
with_middlename(string|null $middlename)
Set middle name.
at line 1170
string|null
get_alternatename()
Get alternate name.
at line 1182
user
with_alternatename(string|null $alternatename)
Set alternate name.
at line 1194
string|null
get_moodlenetprofile()
Get MoodleNet profile.
at line 1206
user
with_moodlenetprofile(string|null $moodlenetprofile)
Set MoodleNet profile.