MIDDAG for Moodle

category extends abstract_moodle_entity

Category Entity (Moodle Native).

Table of Contents

Properties

$coursecount  : int
$depth  : int
$description  : string|null
$descriptionformat  : int
$id  : int
$idnumber  : string|null
$name  : string
$parent  : int
$path  : string
$sortorder  : int
$theme  : string|null
$timecreated  : int
$timemodified  : int
$visible  : int
$visibleold  : 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_coursecount()  : int
get_depth()  : int
get_description()  : null|string
get_descriptionformat()  : int
get_id()  : null|int
Get the entity unique identifier.
get_idnumber()  : null|string
get_name()  : string
get_parent()  : int
get_path()  : string
get_sortorder()  : int
get_table()  : string
Returns the Moodle DB table used by this entity.
get_theme()  : null|string
get_timecreated()  : int
Get entity creation timestamp.
get_timemodified()  : int
Get entity modification timestamp.
get_visible()  : int
get_visibleold()  : 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_coursecount()  : self
with_depth()  : self
with_description()  : self
with_descriptionformat()  : self
with_id()  : $this
Set entity identifier.
with_idnumber()  : self
with_name()  : self
with_parent()  : self
with_path()  : self
with_sortorder()  : self
with_theme()  : self
with_timecreated()  : $this
Set entity creation timestamp.
with_timemodified()  : $this
Set entity modification timestamp.
with_visible()  : self
with_visibleold()  : self

Properties

$coursecount

protected int $coursecount = 0

$description

protected string|null $description = null

$descriptionformat

protected int $descriptionformat = 0

$idnumber

protected string|null $idnumber = null

$theme

protected string|null $theme = null

$visibleold

protected int $visibleold = 1

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
stdClass

from_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
static

get_coursecount()

public get_coursecount() : int
Return values
int

get_depth()

public get_depth() : int
Return values
int

get_description()

public get_description() : null|string
Return values
null|string

get_descriptionformat()

public get_descriptionformat() : int
Return values
int

get_idnumber()

public get_idnumber() : null|string
Return values
null|string

get_name()

public get_name() : string
Return values
string

get_parent()

public get_parent() : int
Return values
int

get_path()

public get_path() : string
Return values
string

get_sortorder()

public get_sortorder() : int
Return values
int

get_table()

Returns the Moodle DB table used by this entity.

public static get_table() : string
Return values
string

get_theme()

public get_theme() : null|string
Return values
null|string

get_timecreated()

Get entity creation timestamp.

public get_timecreated() : int
Return values
int

get_timemodified()

Get entity modification timestamp.

public get_timemodified() : int
Return values
int

get_visible()

public get_visible() : int
Return values
int

get_visibleold()

public get_visibleold() : int
Return values
int

jsonSerialize()

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

public jsonSerialize() : array<string, mixed>
Tags
noinspection

PhpMethodNamingConventionInspection

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
stdClass

with_coursecount()

public with_coursecount(int $coursecount) : self
Parameters
$coursecount : int
Return values
self

with_depth()

public with_depth(int $depth) : self
Parameters
$depth : int
Return values
self

with_description()

public with_description(string|null $description) : self
Parameters
$description : string|null
Return values
self

with_descriptionformat()

public with_descriptionformat(int $descriptionformat) : self
Parameters
$descriptionformat : int
Return values
self

with_id()

Set entity identifier.

public with_id(null|int $id) : $this
Parameters
$id : null|int
Return values
$this

with_idnumber()

public with_idnumber(string|null $idnumber) : self
Parameters
$idnumber : string|null
Return values
self

with_name()

public with_name(string $name) : self
Parameters
$name : string
Return values
self

with_parent()

public with_parent(int $parent) : self
Parameters
$parent : int
Return values
self

with_path()

public with_path(string $path) : self
Parameters
$path : string
Return values
self

with_sortorder()

public with_sortorder(int $sortorder) : self
Parameters
$sortorder : int
Return values
self

with_theme()

public with_theme(string|null $theme) : self
Parameters
$theme : string|null
Return values
self

with_timecreated()

Set entity creation timestamp.

public with_timecreated(int $timecreated) : $this
Parameters
$timecreated : int
Return values
$this

with_timemodified()

Set entity modification timestamp.

public with_timemodified(int $timemodified) : $this
Parameters
$timemodified : int
Return values
$this

with_visible()

public with_visible(int $visible) : self
Parameters
$visible : int
Return values
self

with_visibleold()

public with_visibleold(int $visibleold) : self
Parameters
$visibleold : int
Return values
self

        
On this page

Search results