class user_enrolment extends abstract_moodle_entity

User Enrolment 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 int $status
protected int $enrolid
protected int $userid
protected int $timestart
protected int $timeend
protected int $modifierid

Methods

mixed
__get(string $name)

Magic getter to allow reading protected properties.

bool
__isset(string $name)

Magic isset to allow checking protected properties.

void
__set(string $name, mixed $value)

Magic setter.

array
jsonSerialize()

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

mixed
__call(string $name, array $arguments)

Magic accessor to support get* and with* helpers for entity properties.

static string
get_table()

Returns the Moodle database table name.

from_record(array|stdClass $record)

Factory method to create an entity from a Moodle record.

to_record()

Converts the entity to a stdClass record for Moodle APIs.

as_std_class()

Returns the entity as stdClass (alias for to_record).

int|null
get_id()

Get the entity unique identifier.

with_id(int|null $id)

Set entity identifier.

int
get_timecreated()

Get entity creation timestamp.

with_timecreated(int $timecreated)

Set entity creation timestamp.

int
get_timemodified()

Get entity modification timestamp.

with_timemodified(int $timemodified)

Set entity modification timestamp.

array
to_array()

Implementation for entity_interface.

int
get_status()

No description

self
with_status(int $status)

No description

int
get_enrolid()

No description

self
with_enrolid(int $enrolid)

No description

int
get_userid()

No description

self
with_userid(int $userid)

No description

int
get_timestart()

No description

self
with_timestart(int $timestart)

No description

int
get_timeend()

No description

self
with_timeend(int $timeend)

No description

int
get_modifierid()

No description

self
with_modifierid(int $modifierid)

No description

Details

in abstract_entity at line 39
mixed __get(string $name)

Magic getter to allow reading protected properties.

Parameters

string $name

Property name

Return Value

mixed

in abstract_entity at line 55
bool __isset(string $name)

Magic isset to allow checking protected properties.

Parameters

string $name

Property name

Return Value

bool

in abstract_entity at line 66
void __set(string $name, mixed $value)

Magic setter.

Parameters

string $name

Property name

mixed $value Value

Return Value

void

in abstract_entity at line 80
array jsonSerialize()

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

Return Value

array

mixed __call(string $name, array $arguments)

Magic accessor to support get* and with* helpers for entity properties.

Parameters

string $name
array $arguments

Return Value

mixed

at line 55
static string get_table()

Returns the Moodle database table name.

Return Value

string

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.

Parameters

array|stdClass $record

Return Value

abstract_moodle_entity

stdClass to_record()

Converts the entity to a stdClass record for Moodle APIs.

Return Value

stdClass

stdClass as_std_class()

Returns the entity as stdClass (alias for to_record).

Return Value

stdClass

int|null get_id()

Get the entity unique identifier.

Return Value

int|null

abstract_moodle_entity with_id(int|null $id)

Set entity identifier.

Parameters

int|null $id

Return Value

abstract_moodle_entity

int get_timecreated()

Get entity creation timestamp.

Return Value

int

abstract_moodle_entity with_timecreated(int $timecreated)

Set entity creation timestamp.

Parameters

int $timecreated

Return Value

abstract_moodle_entity

int get_timemodified()

Get entity modification timestamp.

Return Value

int

abstract_moodle_entity with_timemodified(int $timemodified)

Set entity modification timestamp.

Parameters

int $timemodified

Return Value

abstract_moodle_entity

array to_array()

Implementation for entity_interface.

Return Value

array

at line 38
int get_status()

No description

Return Value

int

at line 38
self with_status(int $status)

No description

Parameters

int $status

Return Value

self

at line 38
int get_enrolid()

No description

Return Value

int

at line 38
self with_enrolid(int $enrolid)

No description

Parameters

int $enrolid

Return Value

self

at line 38
int get_userid()

No description

Return Value

int

at line 38
self with_userid(int $userid)

No description

Parameters

int $userid

Return Value

self

at line 38
int get_timestart()

No description

Return Value

int

at line 38
self with_timestart(int $timestart)

No description

Parameters

int $timestart

Return Value

self

at line 38
int get_timeend()

No description

Return Value

int

at line 38
self with_timeend(int $timeend)

No description

Parameters

int $timeend

Return Value

self

at line 38
int get_modifierid()

No description

Return Value

int

at line 38
self with_modifierid(int $modifierid)

No description

Parameters

int $modifierid

Return Value

self