Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_customfield\category_controller Class Reference

Class category. More...

Public Member Functions

 add_field (field_controller $field)
 Adds a child field.
 
 delete ()
 Persistent delete parser.
 
 get ($property)
 Persistent getter parser.
 
 get_fields ()
 Return an array of field objects associated with this category.
 
 get_formatted_name ()
 Returns the category name formatted according to configuration context.
 
 get_handler ()
 Gets a handler, if not known retrieve it.
 
 save ()
 Persistent save parser.
 
 set ($property, $value)
 Persistent setter parser.
 
 set_handler (handler $handler)
 Allows to set handler so we don't need to retrieve it later.
 
 to_record ()
 Persistent to_record parser.
 

Static Public Member Functions

static create (int $id, stdClass $record=null, handler $handler=null)
 Creates an instance of category_controller.
 

Protected Member Functions

 __construct (int $id=0, stdClass $record=null)
 category constructor.
 

Protected Attributes

category $category
 Category persistent.
 
field_controller[] $fields = []
 
handler $handler
 

Detailed Description

Class category.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_customfield\category_controller::__construct ( int $id = 0,
stdClass $record = null )
protected

category constructor.

This class is not abstract, however the constructor was made protected to be consistent with field_controller and data_controller

Parameters
int$id
stdClass | null$record

Member Function Documentation

◆ add_field()

core_customfield\category_controller::add_field ( field_controller $field)

Adds a child field.

Parameters
field_controller$field

◆ create()

static core_customfield\category_controller::create ( int $id,
stdClass $record = null,
handler $handler = null )
static

Creates an instance of category_controller.

Either $id or $record or $handler need to be specified If handler is known pass it to constructor to avoid retrieving it later Component, area and itemid must not conflict with the ones in handler

Parameters
int$id
stdClass | null$record
handler | null$handler
Return values
category_controller
Exceptions
moodle_exception
coding_exception

◆ delete()

core_customfield\category_controller::delete ( )
final

Persistent delete parser.

Return values
bool

◆ get()

core_customfield\category_controller::get ( $property)
final

Persistent getter parser.

Parameters
string$property
Return values
mixed

◆ get_fields()

core_customfield\category_controller::get_fields ( )

Return an array of field objects associated with this category.

Return values
field_controller[]

◆ get_formatted_name()

core_customfield\category_controller::get_formatted_name ( )

Returns the category name formatted according to configuration context.

Return values
string

◆ get_handler()

core_customfield\category_controller::get_handler ( )

Gets a handler, if not known retrieve it.

Return values
handler

◆ save()

core_customfield\category_controller::save ( )
final

Persistent save parser.

Return values
void

◆ set()

core_customfield\category_controller::set ( $property,
$value )
final

Persistent setter parser.

Parameters
string$property
mixed$value

◆ set_handler()

core_customfield\category_controller::set_handler ( handler $handler)

Allows to set handler so we don't need to retrieve it later.

Parameters
handler$handler
Exceptions
coding_exception

◆ to_record()

core_customfield\category_controller::to_record ( )
final

Persistent to_record parser.

Return values
stdClass

The documentation for this class was generated from the following file: