cohort
class cohort extends abstract_moodle_entity
Cohort 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 | $contextid | ||
| protected string | $name | ||
| protected string|null | $idnumber | ||
| protected string|null | $description | ||
| protected int | $descriptionformat | ||
| protected int | $visible | ||
| protected string | $component | ||
| protected string|null | $theme |
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.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
abstract_entity at line 37
mixed
__get(string $name)
Magic getter to allow reading protected properties.
in
abstract_entity at line 53
bool
__isset(string $name)
Magic isset to allow checking protected properties.
in
abstract_entity at line 64
void
__set(string $name, mixed $value)
Magic setter.
in
abstract_entity at line 78
array
jsonSerialize()
Serializes the object to a value that can be natively serialized by json_encode().
in
abstract_moodle_entity at line 47
mixed
__call(string $name, array $arguments)
Magic accessor to support get* and with* helpers for entity properties.
at line 61
static string
get_table()
Returns the Moodle database table name.
in
abstract_moodle_entity at line 94
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 117
stdClass
to_record()
Converts the entity to a stdClass record for Moodle APIs.
in
abstract_moodle_entity at line 133
stdClass
as_std_class()
Returns the entity as stdClass (alias for to_record).
in
abstract_moodle_entity at line 143
int|null
get_id()
Get the entity unique identifier.
in
abstract_moodle_entity at line 155
abstract_moodle_entity
with_id(int|null $id)
Set entity identifier.
in
abstract_moodle_entity at line 167
int
get_timecreated()
Get entity creation timestamp.
in
abstract_moodle_entity at line 179
abstract_moodle_entity
with_timecreated(int $timecreated)
Set entity creation timestamp.
in
abstract_moodle_entity at line 191
int
get_timemodified()
Get entity modification timestamp.
in
abstract_moodle_entity at line 203
abstract_moodle_entity
with_timemodified(int $timemodified)
Set entity modification timestamp.
in
abstract_moodle_entity at line 215
array
to_array()
Implementation for entity_interface.
at line 40
int
get_contextid()
No description
at line 40
self
with_contextid(int $contextid)
No description
at line 40
string
get_name()
No description
at line 40
self
with_name(string $name)
No description
at line 40
null|string
get_idnumber()
No description
at line 40
self
with_idnumber(?string $idnumber)
No description
at line 40
null|string
get_description()
No description
at line 40
self
with_description(?string $description)
No description
at line 40
int
get_descriptionformat()
No description
at line 40
self
with_descriptionformat(int $descriptionformat)
No description
at line 40
int
get_visible()
No description
at line 40
self
with_visible(int $visible)
No description
at line 40
string
get_component()
No description
at line 40
self
with_component(string $component)
No description
at line 40
null|string
get_theme()
No description
at line 40
self
with_theme(?string $theme)
No description