class course extends abstract_moodle_entity

Course 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 $category
protected int $sortorder
protected string $fullname
protected string $shortname
protected string $idnumber
protected string|null $summary
protected int $summaryformat
protected string $format
protected int $showgrades
protected int $newsitems
protected int $startdate
protected int $enddate
protected int $relativedatesmode
protected int $marker
protected int $maxbytes
protected int $legacyfiles
protected int $showreports
protected int $visible
protected int $visibleold
protected int|null $downloadcontent
protected int $groupmode
protected int $groupmodeforce
protected int $defaultgroupingid
protected string $lang
protected string $calendartype
protected string $theme
protected int $requested
protected int $enablecompletion
protected int $completionnotify
protected int $cacherev
protected int|null $originalcourseid
protected int $showactivitydates
protected int|null $showcompletionconditions
protected string|null $pdfexportfont

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_category()

No description

self
with_category(int $category)

No description

int
get_sortorder()

No description

self
with_sortorder(int $sortorder)

No description

string
get_fullname()

No description

self
with_fullname(string $fullname)

No description

string
get_shortname()

No description

self
with_shortname(string $shortname)

No description

string
get_idnumber()

No description

self
with_idnumber(string $idnumber)

No description

null|string
get_summary()

No description

self
with_summary(?string $summary)

No description

int
get_summaryformat()

No description

self
with_summaryformat(int $summaryformat)

No description

string
get_format()

No description

self
with_format(string $format)

No description

int
get_showgrades()

No description

self
with_showgrades(int $showgrades)

No description

int
get_newsitems()

No description

self
with_newsitems(int $newsitems)

No description

int
get_startdate()

No description

self
with_startdate(int $startdate)

No description

int
get_enddate()

No description

self
with_enddate(int $enddate)

No description

int
get_relativedatesmode()

No description

self
with_relativedatesmode(int $relativedatesmode)

No description

int
get_marker()

No description

self
with_marker(int $marker)

No description

int
get_maxbytes()

No description

self
with_maxbytes(int $maxbytes)

No description

int
get_legacyfiles()

No description

self
with_legacyfiles(int $legacyfiles)

No description

int
get_showreports()

No description

self
with_showreports(int $showreports)

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

null|int
get_downloadcontent()

No description

self
with_downloadcontent(?int $downloadcontent)

No description

int
get_groupmode()

No description

self
with_groupmode(int $groupmode)

No description

int
get_groupmodeforce()

No description

self
with_groupmodeforce(int $groupmodeforce)

No description

int
get_defaultgroupingid()

No description

self
with_defaultgroupingid(int $defaultgroupingid)

No description

string
get_lang()

No description

self
with_lang(string $lang)

No description

string
get_calendartype()

No description

self
with_calendartype(string $calendartype)

No description

string
get_theme()

No description

self
with_theme(string $theme)

No description

int
get_requested()

No description

self
with_requested(int $requested)

No description

int
get_enablecompletion()

No description

self
with_enablecompletion(int $enablecompletion)

No description

int
get_completionnotify()

No description

self
with_completionnotify(int $completionnotify)

No description

int
get_cacherev()

No description

self
with_cacherev(int $cacherev)

No description

null|int
get_originalcourseid()

No description

self
with_originalcourseid(?int $originalcourseid)

No description

int
get_showactivitydates()

No description

self
with_showactivitydates(int $showactivitydates)

No description

null|int
get_showcompletionconditions()

No description

self
with_showcompletionconditions(?int $showcompletionconditions)

No description

null|string
get_pdfexportfont()

No description

self
with_pdfexportfont(?string $pdfexportfont)

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 167
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 94
int get_category()

No description

Return Value

int

at line 94
self with_category(int $category)

No description

Parameters

int $category

Return Value

self

at line 94
int get_sortorder()

No description

Return Value

int

at line 94
self with_sortorder(int $sortorder)

No description

Parameters

int $sortorder

Return Value

self

at line 94
string get_fullname()

No description

Return Value

string

at line 94
self with_fullname(string $fullname)

No description

Parameters

string $fullname

Return Value

self

at line 94
string get_shortname()

No description

Return Value

string

at line 94
self with_shortname(string $shortname)

No description

Parameters

string $shortname

Return Value

self

at line 94
string get_idnumber()

No description

Return Value

string

at line 94
self with_idnumber(string $idnumber)

No description

Parameters

string $idnumber

Return Value

self

at line 94
null|string get_summary()

No description

Return Value

null|string

at line 94
self with_summary(?string $summary)

No description

Parameters

?string $summary

Return Value

self

at line 94
int get_summaryformat()

No description

Return Value

int

at line 94
self with_summaryformat(int $summaryformat)

No description

Parameters

int $summaryformat

Return Value

self

at line 94
string get_format()

No description

Return Value

string

at line 94
self with_format(string $format)

No description

Parameters

string $format

Return Value

self

at line 94
int get_showgrades()

No description

Return Value

int

at line 94
self with_showgrades(int $showgrades)

No description

Parameters

int $showgrades

Return Value

self

at line 94
int get_newsitems()

No description

Return Value

int

at line 94
self with_newsitems(int $newsitems)

No description

Parameters

int $newsitems

Return Value

self

at line 94
int get_startdate()

No description

Return Value

int

at line 94
self with_startdate(int $startdate)

No description

Parameters

int $startdate

Return Value

self

at line 94
int get_enddate()

No description

Return Value

int

at line 94
self with_enddate(int $enddate)

No description

Parameters

int $enddate

Return Value

self

at line 94
int get_relativedatesmode()

No description

Return Value

int

at line 94
self with_relativedatesmode(int $relativedatesmode)

No description

Parameters

int $relativedatesmode

Return Value

self

at line 94
int get_marker()

No description

Return Value

int

at line 94
self with_marker(int $marker)

No description

Parameters

int $marker

Return Value

self

at line 94
int get_maxbytes()

No description

Return Value

int

at line 94
self with_maxbytes(int $maxbytes)

No description

Parameters

int $maxbytes

Return Value

self

at line 94
int get_legacyfiles()

No description

Return Value

int

at line 94
self with_legacyfiles(int $legacyfiles)

No description

Parameters

int $legacyfiles

Return Value

self

at line 94
int get_showreports()

No description

Return Value

int

at line 94
self with_showreports(int $showreports)

No description

Parameters

int $showreports

Return Value

self

at line 94
int get_visible()

No description

Return Value

int

at line 94
self with_visible(int $visible)

No description

Parameters

int $visible

Return Value

self

at line 94
int get_visibleold()

No description

Return Value

int

at line 94
self with_visibleold(int $visibleold)

No description

Parameters

int $visibleold

Return Value

self

at line 94
null|int get_downloadcontent()

No description

Return Value

null|int

at line 94
self with_downloadcontent(?int $downloadcontent)

No description

Parameters

?int $downloadcontent

Return Value

self

at line 94
int get_groupmode()

No description

Return Value

int

at line 94
self with_groupmode(int $groupmode)

No description

Parameters

int $groupmode

Return Value

self

at line 94
int get_groupmodeforce()

No description

Return Value

int

at line 94
self with_groupmodeforce(int $groupmodeforce)

No description

Parameters

int $groupmodeforce

Return Value

self

at line 94
int get_defaultgroupingid()

No description

Return Value

int

at line 94
self with_defaultgroupingid(int $defaultgroupingid)

No description

Parameters

int $defaultgroupingid

Return Value

self

at line 94
string get_lang()

No description

Return Value

string

at line 94
self with_lang(string $lang)

No description

Parameters

string $lang

Return Value

self

at line 94
string get_calendartype()

No description

Return Value

string

at line 94
self with_calendartype(string $calendartype)

No description

Parameters

string $calendartype

Return Value

self

at line 94
string get_theme()

No description

Return Value

string

at line 94
self with_theme(string $theme)

No description

Parameters

string $theme

Return Value

self

at line 94
int get_requested()

No description

Return Value

int

at line 94
self with_requested(int $requested)

No description

Parameters

int $requested

Return Value

self

at line 94
int get_enablecompletion()

No description

Return Value

int

at line 94
self with_enablecompletion(int $enablecompletion)

No description

Parameters

int $enablecompletion

Return Value

self

at line 94
int get_completionnotify()

No description

Return Value

int

at line 94
self with_completionnotify(int $completionnotify)

No description

Parameters

int $completionnotify

Return Value

self

at line 94
int get_cacherev()

No description

Return Value

int

at line 94
self with_cacherev(int $cacherev)

No description

Parameters

int $cacherev

Return Value

self

at line 94
null|int get_originalcourseid()

No description

Return Value

null|int

at line 94
self with_originalcourseid(?int $originalcourseid)

No description

Parameters

?int $originalcourseid

Return Value

self

at line 94
int get_showactivitydates()

No description

Return Value

int

at line 94
self with_showactivitydates(int $showactivitydates)

No description

Parameters

int $showactivitydates

Return Value

self

at line 94
null|int get_showcompletionconditions()

No description

Return Value

null|int

at line 94
self with_showcompletionconditions(?int $showcompletionconditions)

No description

Parameters

?int $showcompletionconditions

Return Value

self

at line 94
null|string get_pdfexportfont()

No description

Return Value

null|string

at line 94
self with_pdfexportfont(?string $pdfexportfont)

No description

Parameters

?string $pdfexportfont

Return Value

self