course extends abstract_moodle_entity
Course Entity (Moodle Native).
Table of Contents
Properties
- $cacherev : int
- $calendartype : string
- $category : int
- $completionnotify : int
- $defaultgroupingid : int
- $downloadcontent : int|null
- $enablecompletion : int
- $enddate : int
- $format : string
- $fullname : string
- $groupmode : int
- $groupmodeforce : int
- $id : int
- $idnumber : string
- $lang : string
- $legacyfiles : int
- $marker : int
- $maxbytes : int
- $newsitems : int
- $originalcourseid : int|null
- $pdfexportfont : string|null
- $relativedatesmode : int
- $requested : int
- $shortname : string
- $showactivitydates : int
- $showcompletionconditions : int|null
- $showgrades : int
- $showreports : int
- $sortorder : int
- $startdate : int
- $summary : string|null
- $summaryformat : int
- $theme : string
- $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_cacherev() : int
- get_calendartype() : string
- get_category() : int
- get_completionnotify() : int
- get_defaultgroupingid() : int
- get_downloadcontent() : null|int
- get_enablecompletion() : int
- get_enddate() : int
- get_format() : string
- get_fullname() : string
- get_groupmode() : int
- get_groupmodeforce() : int
- get_id() : null|int
- Get the entity unique identifier.
- get_idnumber() : string
- get_lang() : string
- get_legacyfiles() : int
- get_marker() : int
- get_maxbytes() : int
- get_newsitems() : int
- get_originalcourseid() : null|int
- get_pdfexportfont() : null|string
- get_relativedatesmode() : int
- get_requested() : int
- get_shortname() : string
- get_showactivitydates() : int
- get_showcompletionconditions() : null|int
- get_showgrades() : int
- get_showreports() : int
- get_sortorder() : int
- get_startdate() : int
- get_summary() : null|string
- get_summaryformat() : int
- get_table() : string
- Returns the Moodle database table name.
- get_theme() : 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_cacherev() : self
- with_calendartype() : self
- with_category() : self
- with_completionnotify() : self
- with_defaultgroupingid() : self
- with_downloadcontent() : self
- with_enablecompletion() : self
- with_enddate() : self
- with_format() : self
- with_fullname() : self
- with_groupmode() : self
- with_groupmodeforce() : self
- with_id() : $this
- Set entity identifier.
- with_idnumber() : self
- with_lang() : self
- with_legacyfiles() : self
- with_marker() : self
- with_maxbytes() : self
- with_newsitems() : self
- with_originalcourseid() : self
- with_pdfexportfont() : self
- with_relativedatesmode() : self
- with_requested() : self
- with_shortname() : self
- with_showactivitydates() : self
- with_showcompletionconditions() : self
- with_showgrades() : self
- with_showreports() : self
- with_sortorder() : self
- with_startdate() : self
- with_summary() : self
- with_summaryformat() : 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
$cacherev
protected
int
$cacherev
= 0
$calendartype
protected
string
$calendartype
= ''
$category
protected
int
$category
= 0
$completionnotify
protected
int
$completionnotify
= 0
$defaultgroupingid
protected
int
$defaultgroupingid
= 0
$downloadcontent
protected
int|null
$downloadcontent
= null
$enablecompletion
protected
int
$enablecompletion
= 0
$enddate
protected
int
$enddate
= 0
$format
protected
string
$format
= 'topics'
$fullname
protected
string
$fullname
= ''
$groupmode
protected
int
$groupmode
= 0
$groupmodeforce
protected
int
$groupmodeforce
= 0
$id
protected
int
$id
= 0
$idnumber
protected
string
$idnumber
= ''
$lang
protected
string
$lang
= ''
$legacyfiles
protected
int
$legacyfiles
= 0
$marker
protected
int
$marker
= 0
$maxbytes
protected
int
$maxbytes
= 0
$newsitems
protected
int
$newsitems
= 1
$originalcourseid
protected
int|null
$originalcourseid
= null
$pdfexportfont
protected
string|null
$pdfexportfont
= null
$relativedatesmode
protected
int
$relativedatesmode
= 0
$requested
protected
int
$requested
= 0
$shortname
protected
string
$shortname
= ''
$showactivitydates
protected
int
$showactivitydates
= 0
$showcompletionconditions
protected
int|null
$showcompletionconditions
= null
$showgrades
protected
int
$showgrades
= 1
$showreports
protected
int
$showreports
= 0
$sortorder
protected
int
$sortorder
= 0
$startdate
protected
int
$startdate
= 0
$summary
protected
string|null
$summary
= null
$summaryformat
protected
int
$summaryformat
= 0
$theme
protected
string
$theme
= ''
$timecreated
protected
int
$timecreated
= 0
$timemodified
protected
int
$timemodified
= 0
$visible
protected
int
$visible
= 1
$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
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_cacherev()
public
get_cacherev() : int
Return values
intget_calendartype()
public
get_calendartype() : string
Return values
stringget_category()
public
get_category() : int
Return values
intget_completionnotify()
public
get_completionnotify() : int
Return values
intget_defaultgroupingid()
public
get_defaultgroupingid() : int
Return values
intget_downloadcontent()
public
get_downloadcontent() : null|int
Return values
null|intget_enablecompletion()
public
get_enablecompletion() : int
Return values
intget_enddate()
public
get_enddate() : int
Return values
intget_format()
public
get_format() : string
Return values
stringget_fullname()
public
get_fullname() : string
Return values
stringget_groupmode()
public
get_groupmode() : int
Return values
intget_groupmodeforce()
public
get_groupmodeforce() : int
Return values
intget_id()
Get the entity unique identifier.
public
get_id() : null|int
Return values
null|intget_idnumber()
public
get_idnumber() : string
Return values
stringget_lang()
public
get_lang() : string
Return values
stringget_legacyfiles()
public
get_legacyfiles() : int
Return values
intget_marker()
public
get_marker() : int
Return values
intget_maxbytes()
public
get_maxbytes() : int
Return values
intget_newsitems()
public
get_newsitems() : int
Return values
intget_originalcourseid()
public
get_originalcourseid() : null|int
Return values
null|intget_pdfexportfont()
public
get_pdfexportfont() : null|string
Return values
null|stringget_relativedatesmode()
public
get_relativedatesmode() : int
Return values
intget_requested()
public
get_requested() : int
Return values
intget_shortname()
public
get_shortname() : string
Return values
stringget_showactivitydates()
public
get_showactivitydates() : int
Return values
intget_showcompletionconditions()
public
get_showcompletionconditions() : null|int
Return values
null|intget_showgrades()
public
get_showgrades() : int
Return values
intget_showreports()
public
get_showreports() : int
Return values
intget_sortorder()
public
get_sortorder() : int
Return values
intget_startdate()
public
get_startdate() : int
Return values
intget_summary()
public
get_summary() : null|string
Return values
null|stringget_summaryformat()
public
get_summaryformat() : int
Return values
intget_table()
Returns the Moodle database table name.
public
static get_table() : string
Return values
stringget_theme()
public
get_theme() : 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
intget_visible()
public
get_visible() : int
Return values
intget_visibleold()
public
get_visibleold() : 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_cacherev()
public
with_cacherev(int $cacherev) : self
Parameters
- $cacherev : int
Return values
selfwith_calendartype()
public
with_calendartype(string $calendartype) : self
Parameters
- $calendartype : string
Return values
selfwith_category()
public
with_category(int $category) : self
Parameters
- $category : int
Return values
selfwith_completionnotify()
public
with_completionnotify(int $completionnotify) : self
Parameters
- $completionnotify : int
Return values
selfwith_defaultgroupingid()
public
with_defaultgroupingid(int $defaultgroupingid) : self
Parameters
- $defaultgroupingid : int
Return values
selfwith_downloadcontent()
public
with_downloadcontent(int|null $downloadcontent) : self
Parameters
- $downloadcontent : int|null
Return values
selfwith_enablecompletion()
public
with_enablecompletion(int $enablecompletion) : self
Parameters
- $enablecompletion : int
Return values
selfwith_enddate()
public
with_enddate(int $enddate) : self
Parameters
- $enddate : int
Return values
selfwith_format()
public
with_format(string $format) : self
Parameters
- $format : string
Return values
selfwith_fullname()
public
with_fullname(string $fullname) : self
Parameters
- $fullname : string
Return values
selfwith_groupmode()
public
with_groupmode(int $groupmode) : self
Parameters
- $groupmode : int
Return values
selfwith_groupmodeforce()
public
with_groupmodeforce(int $groupmodeforce) : self
Parameters
- $groupmodeforce : int
Return values
selfwith_id()
Set entity identifier.
public
with_id(null|int $id) : $this
Parameters
- $id : null|int
Return values
$thiswith_idnumber()
public
with_idnumber(string $idnumber) : self
Parameters
- $idnumber : string
Return values
selfwith_lang()
public
with_lang(string $lang) : self
Parameters
- $lang : string
Return values
selfwith_legacyfiles()
public
with_legacyfiles(int $legacyfiles) : self
Parameters
- $legacyfiles : int
Return values
selfwith_marker()
public
with_marker(int $marker) : self
Parameters
- $marker : int
Return values
selfwith_maxbytes()
public
with_maxbytes(int $maxbytes) : self
Parameters
- $maxbytes : int
Return values
selfwith_newsitems()
public
with_newsitems(int $newsitems) : self
Parameters
- $newsitems : int
Return values
selfwith_originalcourseid()
public
with_originalcourseid(int|null $originalcourseid) : self
Parameters
- $originalcourseid : int|null
Return values
selfwith_pdfexportfont()
public
with_pdfexportfont(string|null $pdfexportfont) : self
Parameters
- $pdfexportfont : string|null
Return values
selfwith_relativedatesmode()
public
with_relativedatesmode(int $relativedatesmode) : self
Parameters
- $relativedatesmode : int
Return values
selfwith_requested()
public
with_requested(int $requested) : self
Parameters
- $requested : int
Return values
selfwith_shortname()
public
with_shortname(string $shortname) : self
Parameters
- $shortname : string
Return values
selfwith_showactivitydates()
public
with_showactivitydates(int $showactivitydates) : self
Parameters
- $showactivitydates : int
Return values
selfwith_showcompletionconditions()
public
with_showcompletionconditions(int|null $showcompletionconditions) : self
Parameters
- $showcompletionconditions : int|null
Return values
selfwith_showgrades()
public
with_showgrades(int $showgrades) : self
Parameters
- $showgrades : int
Return values
selfwith_showreports()
public
with_showreports(int $showreports) : self
Parameters
- $showreports : int
Return values
selfwith_sortorder()
public
with_sortorder(int $sortorder) : self
Parameters
- $sortorder : int
Return values
selfwith_startdate()
public
with_startdate(int $startdate) : self
Parameters
- $startdate : int
Return values
selfwith_summary()
public
with_summary(string|null $summary) : self
Parameters
- $summary : string|null
Return values
selfwith_summaryformat()
public
with_summaryformat(int $summaryformat) : self
Parameters
- $summaryformat : int
Return values
selfwith_theme()
public
with_theme(string $theme) : self
Parameters
- $theme : string
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
Return values
$thiswith_visible()
public
with_visible(int $visible) : self
Parameters
- $visible : int
Return values
selfwith_visibleold()
public
with_visibleold(int $visibleold) : self
Parameters
- $visibleold : int