Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
lesson_base Class Reference

Abstract class to provide a core functions to the all lesson classes. More...

Inheritance diagram for lesson_base:
lesson lesson_page lesson_page_answer lesson_page_type_branchtable lesson_page_type_cluster lesson_page_type_endofbranch lesson_page_type_endofcluster lesson_page_type_essay lesson_page_type_matching lesson_page_type_multichoice lesson_page_type_numerical lesson_page_type_shortanswer lesson_page_type_truefalse

Public Member Functions

 __construct ($properties)
 The constructor. More...
 
 __get ($key)
 Magic get method. More...
 
 __isset ($key)
 Stupid PHP needs an isset magic method if you use the get magic method and still want empty calls to work.... More...
 
 __set ($key, $value)
 Magic property method. More...
 
 properties ()
 If implemented should create a new instance, save it in the DB and return it. More...
 

Protected Attributes

stdClass $properties
 An object containing properties.
 

Detailed Description

Abstract class to provide a core functions to the all lesson classes.

This class should be abstracted by ALL classes with the lesson module to ensure that all classes within this module can be interacted with in the same way.

This class provides the user with a basic properties array that can be fetched or set via magic methods, or alternatively by defining methods get_blah() or set_blah() within the extending object.

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

Constructor & Destructor Documentation

◆ __construct()

lesson_base::__construct (   $properties)

The constructor.

Parameters
stdClass$properties

Member Function Documentation

◆ __get()

lesson_base::__get (   $key)

Magic get method.

Attempts to call a get_$key method to return the property and ralls over to return the raw property

Parameters
str$key
Return values
mixed

◆ __isset()

lesson_base::__isset (   $key)

Stupid PHP needs an isset magic method if you use the get magic method and still want empty calls to work....

blah ~!

Parameters
string$key
Return values
bool

◆ __set()

lesson_base::__set (   $key,
  $value 
)

Magic property method.

Attempts to call a set_$key method if one exists otherwise falls back to simply set the property

Parameters
string$key
mixed$value

◆ properties()

lesson_base::properties ( )

If implemented should create a new instance, save it in the DB and return it.

If implemented should load an instance from the DB and return it Fetches all of the properties of the object

Return values
stdClass

Reimplemented in lesson_page.


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