MIDDAG for Moodle

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

$email

protected string $email = ''

$emailstop

protected int $emailstop = 0

$firstaccess

protected int $firstaccess = 0

$firstname

protected string $firstname = ''

$firstnamephonetic

protected string|null $firstnamephonetic = null

$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 = ''

$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
stdClass

from_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
static

get_address()

Get address.

public get_address() : string
Return values
string

get_alternatename()

Get alternate name.

public get_alternatename() : null|string
Return values
null|string

get_auth()

Get authentication plugin.

public get_auth() : string
Return values
string

get_autosubscribe()

Get autosubscribe preference.

public get_autosubscribe() : int
Return values
int

get_calendartype()

Get calendar type.

public get_calendartype() : string
Return values
string

get_city()

Get city.

public get_city() : string
Return values
string

get_confirmed()

Get confirmation flag.

public get_confirmed() : int
Return values
int

get_country()

Get country code.

public get_country() : string
Return values
string

get_currentlogin()

Get current login timestamp.

public get_currentlogin() : int
Return values
int

get_deleted()

Get deleted flag.

public get_deleted() : int
Return values
int

get_department()

Get department.

public get_department() : string
Return values
string

get_description()

Get description.

public get_description() : null|string
Return values
null|string

get_descriptionformat()

Get description format.

public get_descriptionformat() : int
Return values
int

get_email()

Get email.

public get_email() : string
Return values
string

get_emailstop()

Get email stop flag.

public get_emailstop() : int
Return values
int

get_firstaccess()

Get first access timestamp.

public get_firstaccess() : int
Return values
int

get_firstname()

Get first name.

public get_firstname() : string
Return values
string

get_firstnamephonetic()

Get firstname phonetic.

public get_firstnamephonetic() : null|string
Return values
null|string

get_fullname()

Helper to get fullname.

public get_fullname() : string
Return values
string

get_idnumber()

Get idnumber.

public get_idnumber() : string
Return values
string

get_imagealt()

Get image alt text.

public get_imagealt() : null|string
Return values
null|string

get_institution()

Get institution.

public get_institution() : string
Return values
string

get_lang()

Get language.

public get_lang() : string
Return values
string

get_lastaccess()

Get last access timestamp.

public get_lastaccess() : int
Return values
int

get_lastip()

Get last IP.

public get_lastip() : string
Return values
string

get_lastlogin()

Get last login timestamp.

public get_lastlogin() : int
Return values
int

get_lastname()

Get last name.

public get_lastname() : string
Return values
string

get_lastnamephonetic()

Get lastname phonetic.

public get_lastnamephonetic() : null|string
Return values
null|string

get_maildigest()

Get mail digest mode.

public get_maildigest() : int
Return values
int

get_maildisplay()

Get mail display preference.

public get_maildisplay() : int
Return values
int

get_mailformat()

Get mail format.

public get_mailformat() : int
Return values
int

get_middlename()

Get middle name.

public get_middlename() : null|string
Return values
null|string

get_mnethostid()

Get MNet host identifier.

public get_mnethostid() : int
Return values
int

get_moodlenetprofile()

Get MoodleNet profile.

public get_moodlenetprofile() : null|string
Return values
null|string

get_password()

Get hashed password.

public get_password() : string
Return values
string

get_phone1()

Get primary phone.

public get_phone1() : string
Return values
string

get_phone2()

Get secondary phone.

public get_phone2() : string
Return values
string

get_picture()

Get picture revision.

public get_picture() : int
Return values
int

get_policyagreed()

Get policy agreement flag.

public get_policyagreed() : int
Return values
int

get_secret()

Get secret string.

public get_secret() : string
Return values
string

get_suspended()

Get suspended flag.

public get_suspended() : int
Return values
int

get_table()

Returns the Moodle database table name.

public static get_table() : string
Return values
string

get_theme()

Get theme.

public get_theme() : string
Return values
string

get_timecreated()

Get entity creation timestamp.

public get_timecreated() : int
Return values
int

get_timemodified()

Get entity modification timestamp.

public get_timemodified() : int
Return values
int

get_timezone()

Get timezone.

public get_timezone() : string
Return values
string

get_trackforums()

Get forums tracking preference.

public get_trackforums() : int
Return values
int

get_trustbitmask()

Get trust bitmask.

public get_trustbitmask() : int
Return values
int

get_username()

Get username.

public get_username() : string
Return values
string

jsonSerialize()

Serializes the object to a value that can be natively serialized by json_encode().

public jsonSerialize() : array<string, mixed>
Tags
noinspection

PhpMethodNamingConventionInspection

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
stdClass

with_address()

Set address.

public with_address(string $address) : $this
Parameters
$address : string
Return values
$this

with_alternatename()

Set alternate name.

public with_alternatename(null|string $alternatename) : $this
Parameters
$alternatename : null|string
Return values
$this

with_auth()

Set authentication plugin.

public with_auth(string $auth) : $this
Parameters
$auth : string
Return values
$this

with_autosubscribe()

Set autosubscribe preference.

public with_autosubscribe(int $autosubscribe) : $this
Parameters
$autosubscribe : int
Return values
$this

with_calendartype()

Set calendar type.

public with_calendartype(string $calendartype) : $this
Parameters
$calendartype : string
Return values
$this

with_city()

Set city.

public with_city(string $city) : $this
Parameters
$city : string
Return values
$this

with_confirmed()

Set confirmation flag.

public with_confirmed(int $confirmed) : $this
Parameters
$confirmed : int
Return values
$this

with_country()

Set country code.

public with_country(string $country) : $this
Parameters
$country : string
Return values
$this

with_currentlogin()

Set current login timestamp.

public with_currentlogin(int $currentlogin) : $this
Parameters
$currentlogin : int
Return values
$this

with_deleted()

Set deleted flag.

public with_deleted(int $deleted) : $this
Parameters
$deleted : int
Return values
$this

with_department()

Set department.

public with_department(string $department) : $this
Parameters
$department : string
Return values
$this

with_description()

Set description.

public with_description(null|string $description) : $this
Parameters
$description : null|string
Return values
$this

with_descriptionformat()

Set description format.

public with_descriptionformat(int $descriptionformat) : $this
Parameters
$descriptionformat : int
Return values
$this

with_email()

Set email.

public with_email(string $email) : $this
Parameters
$email : string
Return values
$this

with_emailstop()

Set email stop flag.

public with_emailstop(int $emailstop) : $this
Parameters
$emailstop : int
Return values
$this

with_firstaccess()

Set first access timestamp.

public with_firstaccess(int $firstaccess) : $this
Parameters
$firstaccess : int
Return values
$this

with_firstname()

Set first name.

public with_firstname(string $firstname) : $this
Parameters
$firstname : string
Return values
$this

with_firstnamephonetic()

Set firstname phonetic.

public with_firstnamephonetic(null|string $firstnamephonetic) : $this
Parameters
$firstnamephonetic : null|string
Return values
$this

with_id()

Set entity identifier.

public with_id(null|int $id) : $this
Parameters
$id : null|int
Return values
$this

with_idnumber()

Set idnumber.

public with_idnumber(string $idnumber) : $this
Parameters
$idnumber : string
Return values
$this

with_imagealt()

Set image alt text.

public with_imagealt(null|string $imagealt) : $this
Parameters
$imagealt : null|string
Return values
$this

with_institution()

Set institution.

public with_institution(string $institution) : $this
Parameters
$institution : string
Return values
$this

with_lang()

Set language.

public with_lang(string $lang) : $this
Parameters
$lang : string
Return values
$this

with_lastaccess()

Set last access timestamp.

public with_lastaccess(int $lastaccess) : $this
Parameters
$lastaccess : int
Return values
$this

with_lastip()

Set last IP.

public with_lastip(string $lastip) : $this
Parameters
$lastip : string
Return values
$this

with_lastlogin()

Set last login timestamp.

public with_lastlogin(int $lastlogin) : $this
Parameters
$lastlogin : int
Return values
$this

with_lastname()

Set last name.

public with_lastname(string $lastname) : $this
Parameters
$lastname : string
Return values
$this

with_lastnamephonetic()

Set lastname phonetic.

public with_lastnamephonetic(null|string $lastnamephonetic) : $this
Parameters
$lastnamephonetic : null|string
Return values
$this

with_maildigest()

Set mail digest mode.

public with_maildigest(int $maildigest) : $this
Parameters
$maildigest : int
Return values
$this

with_maildisplay()

Set mail display preference.

public with_maildisplay(int $maildisplay) : $this
Parameters
$maildisplay : int
Return values
$this

with_mailformat()

Set mail format.

public with_mailformat(int $mailformat) : $this
Parameters
$mailformat : int
Return values
$this

with_middlename()

Set middle name.

public with_middlename(null|string $middlename) : $this
Parameters
$middlename : null|string
Return values
$this

with_mnethostid()

Set MNet host identifier.

public with_mnethostid(int $mnethostid) : $this
Parameters
$mnethostid : int
Return values
$this

with_moodlenetprofile()

Set MoodleNet profile.

public with_moodlenetprofile(null|string $moodlenetprofile) : $this
Parameters
$moodlenetprofile : null|string
Return values
$this

with_password()

Set hashed password.

public with_password(string $password) : $this
Parameters
$password : string
Return values
$this

with_phone1()

Set primary phone.

public with_phone1(string $phone1) : $this
Parameters
$phone1 : string
Return values
$this

with_phone2()

Set secondary phone.

public with_phone2(string $phone2) : $this
Parameters
$phone2 : string
Return values
$this

with_picture()

Set picture revision.

public with_picture(int $picture) : $this
Parameters
$picture : int
Return values
$this

with_policyagreed()

Set policy agreement flag.

public with_policyagreed(int $policyagreed) : $this
Parameters
$policyagreed : int
Return values
$this

with_secret()

Set secret string.

public with_secret(string $secret) : $this
Parameters
$secret : string
Return values
$this

with_suspended()

Set suspended flag.

public with_suspended(int $suspended) : $this
Parameters
$suspended : int
Return values
$this

with_theme()

Set theme.

public with_theme(string $theme) : $this
Parameters
$theme : string
Return values
$this

with_timecreated()

Set entity creation timestamp.

public with_timecreated(int $timecreated) : $this
Parameters
$timecreated : int
Return values
$this

with_timemodified()

Set entity modification timestamp.

public with_timemodified(int $timemodified) : $this
Parameters
$timemodified : int
Return values
$this

with_timezone()

Set timezone.

public with_timezone(string $timezone) : $this
Parameters
$timezone : string
Return values
$this

with_trackforums()

Set forums tracking preference.

public with_trackforums(int $trackforums) : $this
Parameters
$trackforums : int
Return values
$this

with_trustbitmask()

Set trust bitmask.

public with_trustbitmask(int $trustbitmask) : $this
Parameters
$trustbitmask : int
Return values
$this

with_username()

Set username.

public with_username(string $username) : $this
Parameters
$username : string
Return values
$this

        
On this page

Search results