class category extends abstract_moodle_entity

Category 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 string $name
protected string|null $idnumber
protected string|null $description
protected int $descriptionformat
protected int $parent
protected int $sortorder
protected int $coursecount
protected int $visible
protected int $visibleold
protected int $depth
protected string $path
protected string|null $theme

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 DB table used by this entity.

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.

string
get_name()

No description

self
with_name(string $name)

No description

null|string
get_idnumber()

No description

self
with_idnumber(?string $idnumber)

No description

null|string
get_description()

No description

self
with_description(?string $description)

No description

int
get_descriptionformat()

No description

self
with_descriptionformat(int $descriptionformat)

No description

int
get_parent()

No description

self
with_parent(int $parent)

No description

int
get_sortorder()

No description

self
with_sortorder(int $sortorder)

No description

int
get_coursecount()

No description

self
with_coursecount(int $coursecount)

No description

int
get_visible()

No description

self
with_visible(int $visible)

No description

int
get_visibleold()

No description

self
with_visibleold(int $visibleold)

No description

int
get_depth()

No description

self
with_depth(int $depth)

No description

string
get_path()

No description

self
with_path(string $path)

No description

null|string
get_theme()

No description

self
with_theme(?string $theme)

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 81
static string get_table()

Returns the Moodle DB table used by this entity.

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 50
string get_name()

No description

Return Value

string

at line 50
self with_name(string $name)

No description

Parameters

string $name

Return Value

self

at line 50
null|string get_idnumber()

No description

Return Value

null|string

at line 50
self with_idnumber(?string $idnumber)

No description

Parameters

?string $idnumber

Return Value

self

at line 50
null|string get_description()

No description

Return Value

null|string

at line 50
self with_description(?string $description)

No description

Parameters

?string $description

Return Value

self

at line 50
int get_descriptionformat()

No description

Return Value

int

at line 50
self with_descriptionformat(int $descriptionformat)

No description

Parameters

int $descriptionformat

Return Value

self

at line 50
int get_parent()

No description

Return Value

int

at line 50
self with_parent(int $parent)

No description

Parameters

int $parent

Return Value

self

at line 50
int get_sortorder()

No description

Return Value

int

at line 50
self with_sortorder(int $sortorder)

No description

Parameters

int $sortorder

Return Value

self

at line 50
int get_coursecount()

No description

Return Value

int

at line 50
self with_coursecount(int $coursecount)

No description

Parameters

int $coursecount

Return Value

self

at line 50
int get_visible()

No description

Return Value

int

at line 50
self with_visible(int $visible)

No description

Parameters

int $visible

Return Value

self

at line 50
int get_visibleold()

No description

Return Value

int

at line 50
self with_visibleold(int $visibleold)

No description

Parameters

int $visibleold

Return Value

self

at line 50
int get_depth()

No description

Return Value

int

at line 50
self with_depth(int $depth)

No description

Parameters

int $depth

Return Value

self

at line 50
string get_path()

No description

Return Value

string

at line 50
self with_path(string $path)

No description

Parameters

string $path

Return Value

self

at line 50
null|string get_theme()

No description

Return Value

null|string

at line 50
self with_theme(?string $theme)

No description

Parameters

?string $theme

Return Value

self