user_enrolment extends abstract_moodle_entity
User Enrolment Entity (Moodle Native).
Table of Contents
Properties
- $enrolid : int
- $id : int
- $modifierid : int
- $status : int
- $timecreated : int
- $timeend : int
- $timemodified : int
- $timestart : int
- $userid : int
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_enrolid() : int
- get_id() : null|int
- Get the entity unique identifier.
- get_modifierid() : int
- get_status() : int
- get_table() : string
- Returns the Moodle database table name.
- get_timecreated() : int
- Get entity creation timestamp.
- get_timeend() : int
- get_timemodified() : int
- Get entity modification timestamp.
- get_timestart() : int
- get_userid() : int
- 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_enrolid() : self
- with_id() : $this
- Set entity identifier.
- with_modifierid() : self
- with_status() : self
- with_timecreated() : $this
- Set entity creation timestamp.
- with_timeend() : self
- with_timemodified() : $this
- Set entity modification timestamp.
- with_timestart() : self
- with_userid() : self
Properties
$enrolid
protected
int
$enrolid
= 0
$id
protected
int
$id
= 0
$modifierid
protected
int
$modifierid
= 0
$status
protected
int
$status
= 0
$timecreated
protected
int
$timecreated
= 0
$timeend
protected
int
$timeend
= 2147483647
$timemodified
protected
int
$timemodified
= 0
$timestart
protected
int
$timestart
= 0
$userid
protected
int
$userid
= 0
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_enrolid()
public
get_enrolid() : int
Return values
intget_id()
Get the entity unique identifier.
public
get_id() : null|int
Return values
null|intget_modifierid()
public
get_modifierid() : int
Return values
intget_status()
public
get_status() : int
Return values
intget_table()
Returns the Moodle database table name.
public
static get_table() : string
Return values
stringget_timecreated()
Get entity creation timestamp.
public
get_timecreated() : int
Return values
intget_timeend()
public
get_timeend() : int
Return values
intget_timemodified()
Get entity modification timestamp.
public
get_timemodified() : int
Return values
intget_timestart()
public
get_timestart() : int
Return values
intget_userid()
public
get_userid() : int
Return values
intjsonSerialize()
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_enrolid()
public
with_enrolid(int $enrolid) : self
Parameters
- $enrolid : int
Return values
selfwith_id()
Set entity identifier.
public
with_id(null|int $id) : $this
Parameters
- $id : null|int
Return values
$thiswith_modifierid()
public
with_modifierid(int $modifierid) : self
Parameters
- $modifierid : int
Return values
selfwith_status()
public
with_status(int $status) : self
Parameters
- $status : int
Return values
selfwith_timecreated()
Set entity creation timestamp.
public
with_timecreated(int $timecreated) : $this
Parameters
- $timecreated : int
Return values
$thiswith_timeend()
public
with_timeend(int $timeend) : self
Parameters
- $timeend : int
Return values
selfwith_timemodified()
Set entity modification timestamp.
public
with_timemodified(int $timemodified) : $this
Parameters
- $timemodified : int
Return values
$thiswith_timestart()
public
with_timestart(int $timestart) : self
Parameters
- $timestart : int
Return values
selfwith_userid()
public
with_userid(int $userid) : self
Parameters
- $userid : int