enrol extends abstract_moodle_entity
Enrol Entity (Moodle Native).
Table of Contents
Properties
- $cost : string|null
- $courseid : int
- $currency : string|null
- $customchar1 : string|null
- $customchar2 : string|null
- $customchar3 : string|null
- $customdec1 : float|null
- $customdec2 : float|null
- $customint1 : int|null
- $customint2 : int|null
- $customint3 : int|null
- $customint4 : int|null
- $customint5 : int|null
- $customint6 : int|null
- $customint7 : int|null
- $customint8 : int|null
- $customtext1 : string|null
- $customtext2 : string|null
- $customtext3 : string|null
- $customtext4 : string|null
- $enrol : string
- $enrolenddate : int
- $enrolperiod : int
- $enrolstartdate : int
- $expirynotify : int
- $expirythreshold : int
- $id : int
- $name : string|null
- $notifyall : int
- $password : string|null
- $roleid : int
- $sortorder : int
- $status : int
- $timecreated : int
- $timemodified : 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_cost() : null|string
- get_courseid() : int
- get_currency() : null|string
- get_customchar1() : null|string
- get_customchar2() : null|string
- get_customchar3() : null|string
- get_customdec1() : null|float
- get_customdec2() : null|float
- get_customint1() : null|int
- get_customint2() : null|int
- get_customint3() : null|int
- get_customint4() : null|int
- get_customint5() : null|int
- get_customint6() : null|int
- get_customint7() : null|int
- get_customint8() : null|int
- get_customtext1() : null|string
- get_customtext2() : null|string
- get_customtext3() : null|string
- get_customtext4() : null|string
- get_enrol() : string
- get_enrolenddate() : int
- get_enrolperiod() : int
- get_enrolstartdate() : int
- get_expirynotify() : int
- get_expirythreshold() : int
- get_id() : null|int
- Get the entity unique identifier.
- get_name() : null|string
- get_notifyall() : int
- get_password() : null|string
- get_roleid() : int
- get_sortorder() : int
- get_status() : int
- get_table() : string
- Returns the Moodle database table name.
- get_timecreated() : int
- Get entity creation timestamp.
- get_timemodified() : int
- Get entity modification timestamp.
- 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_cost() : self
- with_courseid() : self
- with_currency() : self
- with_customchar1() : self
- with_customchar2() : self
- with_customchar3() : self
- with_customdec1() : self
- with_customdec2() : self
- with_customint1() : self
- with_customint2() : self
- with_customint3() : self
- with_customint4() : self
- with_customint5() : self
- with_customint6() : self
- with_customint7() : self
- with_customint8() : self
- with_customtext1() : self
- with_customtext2() : self
- with_customtext3() : self
- with_customtext4() : self
- with_enrol() : self
- with_enrolenddate() : self
- with_enrolperiod() : self
- with_enrolstartdate() : self
- with_expirynotify() : self
- with_expirythreshold() : self
- with_id() : $this
- Set entity identifier.
- with_name() : self
- with_notifyall() : self
- with_password() : self
- with_roleid() : self
- with_sortorder() : self
- with_status() : self
- with_timecreated() : $this
- Set entity creation timestamp.
- with_timemodified() : $this
- Set entity modification timestamp.
Properties
$cost
protected
string|null
$cost
= null
$courseid
protected
int
$courseid
= 0
$currency
protected
string|null
$currency
= null
$customchar1
protected
string|null
$customchar1
= null
$customchar2
protected
string|null
$customchar2
= null
$customchar3
protected
string|null
$customchar3
= null
$customdec1
protected
float|null
$customdec1
= null
$customdec2
protected
float|null
$customdec2
= null
$customint1
protected
int|null
$customint1
= null
$customint2
protected
int|null
$customint2
= null
$customint3
protected
int|null
$customint3
= null
$customint4
protected
int|null
$customint4
= null
$customint5
protected
int|null
$customint5
= null
$customint6
protected
int|null
$customint6
= null
$customint7
protected
int|null
$customint7
= null
$customint8
protected
int|null
$customint8
= null
$customtext1
protected
string|null
$customtext1
= null
$customtext2
protected
string|null
$customtext2
= null
$customtext3
protected
string|null
$customtext3
= null
$customtext4
protected
string|null
$customtext4
= null
$enrol
protected
string
$enrol
= ''
$enrolenddate
protected
int
$enrolenddate
= 0
$enrolperiod
protected
int
$enrolperiod
= 0
$enrolstartdate
protected
int
$enrolstartdate
= 0
$expirynotify
protected
int
$expirynotify
= 0
$expirythreshold
protected
int
$expirythreshold
= 0
$id
protected
int
$id
= 0
$name
protected
string|null
$name
= null
$notifyall
protected
int
$notifyall
= 0
$password
protected
string|null
$password
= null
$roleid
protected
int
$roleid
= 0
$sortorder
protected
int
$sortorder
= 0
$status
protected
int
$status
= 0
$timecreated
protected
int
$timecreated
= 0
$timemodified
protected
int
$timemodified
= 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_cost()
public
get_cost() : null|string
Return values
null|stringget_courseid()
public
get_courseid() : int
Return values
intget_currency()
public
get_currency() : null|string
Return values
null|stringget_customchar1()
public
get_customchar1() : null|string
Return values
null|stringget_customchar2()
public
get_customchar2() : null|string
Return values
null|stringget_customchar3()
public
get_customchar3() : null|string
Return values
null|stringget_customdec1()
public
get_customdec1() : null|float
Return values
null|floatget_customdec2()
public
get_customdec2() : null|float
Return values
null|floatget_customint1()
public
get_customint1() : null|int
Return values
null|intget_customint2()
public
get_customint2() : null|int
Return values
null|intget_customint3()
public
get_customint3() : null|int
Return values
null|intget_customint4()
public
get_customint4() : null|int
Return values
null|intget_customint5()
public
get_customint5() : null|int
Return values
null|intget_customint6()
public
get_customint6() : null|int
Return values
null|intget_customint7()
public
get_customint7() : null|int
Return values
null|intget_customint8()
public
get_customint8() : null|int
Return values
null|intget_customtext1()
public
get_customtext1() : null|string
Return values
null|stringget_customtext2()
public
get_customtext2() : null|string
Return values
null|stringget_customtext3()
public
get_customtext3() : null|string
Return values
null|stringget_customtext4()
public
get_customtext4() : null|string
Return values
null|stringget_enrol()
public
get_enrol() : string
Return values
stringget_enrolenddate()
public
get_enrolenddate() : int
Return values
intget_enrolperiod()
public
get_enrolperiod() : int
Return values
intget_enrolstartdate()
public
get_enrolstartdate() : int
Return values
intget_expirynotify()
public
get_expirynotify() : int
Return values
intget_expirythreshold()
public
get_expirythreshold() : int
Return values
intget_id()
Get the entity unique identifier.
public
get_id() : null|int
Return values
null|intget_name()
public
get_name() : null|string
Return values
null|stringget_notifyall()
public
get_notifyall() : int
Return values
intget_password()
public
get_password() : null|string
Return values
null|stringget_roleid()
public
get_roleid() : int
Return values
intget_sortorder()
public
get_sortorder() : 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_timemodified()
Get entity modification timestamp.
public
get_timemodified() : 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_cost()
public
with_cost(string|null $cost) : self
Parameters
- $cost : string|null
Return values
selfwith_courseid()
public
with_courseid(int $courseid) : self
Parameters
- $courseid : int
Return values
selfwith_currency()
public
with_currency(string|null $currency) : self
Parameters
- $currency : string|null
Return values
selfwith_customchar1()
public
with_customchar1(string|null $customchar1) : self
Parameters
- $customchar1 : string|null
Return values
selfwith_customchar2()
public
with_customchar2(string|null $customchar2) : self
Parameters
- $customchar2 : string|null
Return values
selfwith_customchar3()
public
with_customchar3(string|null $customchar3) : self
Parameters
- $customchar3 : string|null
Return values
selfwith_customdec1()
public
with_customdec1(float|null $customdec1) : self
Parameters
- $customdec1 : float|null
Return values
selfwith_customdec2()
public
with_customdec2(float|null $customdec2) : self
Parameters
- $customdec2 : float|null
Return values
selfwith_customint1()
public
with_customint1(int|null $customint1) : self
Parameters
- $customint1 : int|null
Return values
selfwith_customint2()
public
with_customint2(int|null $customint2) : self
Parameters
- $customint2 : int|null
Return values
selfwith_customint3()
public
with_customint3(int|null $customint3) : self
Parameters
- $customint3 : int|null
Return values
selfwith_customint4()
public
with_customint4(int|null $customint4) : self
Parameters
- $customint4 : int|null
Return values
selfwith_customint5()
public
with_customint5(int|null $customint5) : self
Parameters
- $customint5 : int|null
Return values
selfwith_customint6()
public
with_customint6(int|null $customint6) : self
Parameters
- $customint6 : int|null
Return values
selfwith_customint7()
public
with_customint7(int|null $customint7) : self
Parameters
- $customint7 : int|null
Return values
selfwith_customint8()
public
with_customint8(int|null $customint8) : self
Parameters
- $customint8 : int|null
Return values
selfwith_customtext1()
public
with_customtext1(string|null $customtext1) : self
Parameters
- $customtext1 : string|null
Return values
selfwith_customtext2()
public
with_customtext2(string|null $customtext2) : self
Parameters
- $customtext2 : string|null
Return values
selfwith_customtext3()
public
with_customtext3(string|null $customtext3) : self
Parameters
- $customtext3 : string|null
Return values
selfwith_customtext4()
public
with_customtext4(string|null $customtext4) : self
Parameters
- $customtext4 : string|null
Return values
selfwith_enrol()
public
with_enrol(string $enrol) : self
Parameters
- $enrol : string
Return values
selfwith_enrolenddate()
public
with_enrolenddate(int $enrolenddate) : self
Parameters
- $enrolenddate : int
Return values
selfwith_enrolperiod()
public
with_enrolperiod(int $enrolperiod) : self
Parameters
- $enrolperiod : int
Return values
selfwith_enrolstartdate()
public
with_enrolstartdate(int $enrolstartdate) : self
Parameters
- $enrolstartdate : int
Return values
selfwith_expirynotify()
public
with_expirynotify(int $expirynotify) : self
Parameters
- $expirynotify : int
Return values
selfwith_expirythreshold()
public
with_expirythreshold(int $expirythreshold) : self
Parameters
- $expirythreshold : int
Return values
selfwith_id()
Set entity identifier.
public
with_id(null|int $id) : $this
Parameters
- $id : null|int
Return values
$thiswith_name()
public
with_name(string|null $name) : self
Parameters
- $name : string|null
Return values
selfwith_notifyall()
public
with_notifyall(int $notifyall) : self
Parameters
- $notifyall : int
Return values
selfwith_password()
public
with_password(string|null $password) : self
Parameters
- $password : string|null
Return values
selfwith_roleid()
public
with_roleid(int $roleid) : self
Parameters
- $roleid : int
Return values
selfwith_sortorder()
public
with_sortorder(int $sortorder) : self
Parameters
- $sortorder : 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_timemodified()
Set entity modification timestamp.
public
with_timemodified(int $timemodified) : $this
Parameters
- $timemodified : int