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 39
mixed
__get(string $name)
Magic getter to allow reading protected properties.
in
abstract_entity at line 55
bool
__isset(string $name)
Magic isset to allow checking protected properties.
in
abstract_entity at line 66
void
__set(string $name, mixed $value)
Magic setter.
in
abstract_entity at line 80
array
jsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
in
abstract_moodle_entity at line 46
mixed
__call(string $name, array $arguments)
Magic accessor to support get* and with* helpers for entity properties.
at line 120
static string
get_table()
Returns the Moodle database table name.
in
abstract_moodle_entity at line 93
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 116
stdClass
to_record()
Converts the entity to a stdClass record for Moodle APIs.
in
abstract_moodle_entity at line 132
stdClass
as_std_class()
Returns the entity as stdClass (alias for to_record).
in
abstract_moodle_entity at line 142
int|null
get_id()
Get the entity unique identifier.
in
abstract_moodle_entity at line 154
abstract_moodle_entity
with_id(int|null $id)
Set entity identifier.
in
abstract_moodle_entity at line 166
int
get_timecreated()
Get entity creation timestamp.
in
abstract_moodle_entity at line 178
abstract_moodle_entity
with_timecreated(int $timecreated)
Set entity creation timestamp.
in
abstract_moodle_entity at line 190
int
get_timemodified()
Get entity modification timestamp.
in
abstract_moodle_entity at line 202
abstract_moodle_entity
with_timemodified(int $timemodified)
Set entity modification timestamp.
in
abstract_moodle_entity at line 214
array
to_array()
Implementation for entity_interface.
at line 130
string
get_fullname()
Helper to get fullname.
at line 140
string
get_auth()
Get authentication plugin.
at line 152
user
with_auth(string $auth)
Set authentication plugin.
at line 164
int
get_confirmed()
Get confirmation flag.
at line 176
user
with_confirmed(int $confirmed)
Set confirmation flag.
at line 188
int
get_policyagreed()
Get policy agreement flag.
at line 200
user
with_policyagreed(int $policyagreed)
Set policy agreement flag.
at line 212
int
get_deleted()
Get deleted flag.
at line 224
user
with_deleted(int $deleted)
Set deleted flag.
at line 236
int
get_suspended()
Get suspended flag.
at line 248
user
with_suspended(int $suspended)
Set suspended flag.
at line 260
int
get_mnethostid()
Get MNet host identifier.
at line 272
user
with_mnethostid(int $mnethostid)
Set MNet host identifier.
at line 284
string
get_username()
Get username.
at line 296
user
with_username(string $username)
Set username.
at line 308
string
get_password()
Get hashed password.
at line 320
user
with_password(string $password)
Set hashed password.
at line 332
string
get_idnumber()
Get idnumber.
at line 344
user
with_idnumber(string $idnumber)
Set idnumber.
at line 356
string
get_firstname()
Get first name.
at line 368
user
with_firstname(string $firstname)
Set first name.
at line 380
string
get_lastname()
Get last name.
at line 392
user
with_lastname(string $lastname)
Set last name.
at line 404
string
get_email()
Get email.
at line 416
user
with_email(string $email)
Set email.
at line 428
int
get_emailstop()
Get email stop flag.
at line 440
user
with_emailstop(int $emailstop)
Set email stop flag.
at line 452
string
get_phone1()
Get primary phone.
at line 464
user
with_phone1(string $phone1)
Set primary phone.
at line 476
string
get_phone2()
Get secondary phone.
at line 488
user
with_phone2(string $phone2)
Set secondary phone.
at line 500
string
get_institution()
Get institution.
at line 512
user
with_institution(string $institution)
Set institution.
at line 524
string
get_department()
Get department.
at line 536
user
with_department(string $department)
Set department.
at line 548
string
get_address()
Get address.
at line 560
user
with_address(string $address)
Set address.
at line 572
string
get_city()
Get city.
at line 584
user
with_city(string $city)
Set city.
at line 596
string
get_country()
Get country code.
at line 608
user
with_country(string $country)
Set country code.
at line 620
string
get_lang()
Get language.
at line 632
user
with_lang(string $lang)
Set language.
at line 644
string
get_calendartype()
Get calendar type.
at line 656
user
with_calendartype(string $calendartype)
Set calendar type.
at line 668
string
get_theme()
Get theme.
at line 680
user
with_theme(string $theme)
Set theme.
at line 692
string
get_timezone()
Get timezone.
at line 704
user
with_timezone(string $timezone)
Set timezone.
at line 716
int
get_firstaccess()
Get first access timestamp.
at line 728
user
with_firstaccess(int $firstaccess)
Set first access timestamp.
at line 740
int
get_lastaccess()
Get last access timestamp.
at line 752
user
with_lastaccess(int $lastaccess)
Set last access timestamp.
at line 764
int
get_lastlogin()
Get last login timestamp.
at line 776
user
with_lastlogin(int $lastlogin)
Set last login timestamp.
at line 788
int
get_currentlogin()
Get current login timestamp.
at line 800
user
with_currentlogin(int $currentlogin)
Set current login timestamp.
at line 812
string
get_lastip()
Get last IP.
at line 824
user
with_lastip(string $lastip)
Set last IP.
at line 836
string
get_secret()
Get secret string.
at line 848
user
with_secret(string $secret)
Set secret string.
at line 860
int
get_picture()
Get picture revision.
at line 872
user
with_picture(int $picture)
Set picture revision.
at line 884
string|null
get_description()
Get description.
at line 896
user
with_description(string|null $description)
Set description.
at line 908
int
get_descriptionformat()
Get description format.
at line 920
user
with_descriptionformat(int $descriptionformat)
Set description format.
at line 932
int
get_mailformat()
Get mail format.
at line 944
user
with_mailformat(int $mailformat)
Set mail format.
at line 956
int
get_maildigest()
Get mail digest mode.
at line 968
user
with_maildigest(int $maildigest)
Set mail digest mode.
at line 980
int
get_maildisplay()
Get mail display preference.
at line 992
user
with_maildisplay(int $maildisplay)
Set mail display preference.
at line 1004
int
get_autosubscribe()
Get autosubscribe preference.
at line 1016
user
with_autosubscribe(int $autosubscribe)
Set autosubscribe preference.
at line 1028
int
get_trackforums()
Get forums tracking preference.
at line 1040
user
with_trackforums(int $trackforums)
Set forums tracking preference.
at line 1052
int
get_trustbitmask()
Get trust bitmask.
at line 1064
user
with_trustbitmask(int $trustbitmask)
Set trust bitmask.
at line 1076
string|null
get_imagealt()
Get image alt text.
at line 1088
user
with_imagealt(string|null $imagealt)
Set image alt text.
at line 1100
string|null
get_lastnamephonetic()
Get lastname phonetic.
at line 1112
user
with_lastnamephonetic(string|null $lastnamephonetic)
Set lastname phonetic.
at line 1124
string|null
get_firstnamephonetic()
Get firstname phonetic.
at line 1136
user
with_firstnamephonetic(string|null $firstnamephonetic)
Set firstname phonetic.
at line 1148
string|null
get_middlename()
Get middle name.
at line 1160
user
with_middlename(string|null $middlename)
Set middle name.
at line 1172
string|null
get_alternatename()
Get alternate name.
at line 1184
user
with_alternatename(string|null $alternatename)
Set alternate name.
at line 1196
string|null
get_moodlenetprofile()
Get MoodleNet profile.
at line 1208
user
with_moodlenetprofile(string|null $moodlenetprofile)
Set MoodleNet profile.