Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
H5PEventBase Class Reference

Public Member Functions

 __construct ($type, $sub_type=NULL, $content_id=NULL, $content_title=NULL, $library_name=NULL, $library_version=NULL)
 Adds event type, h5p library and timestamp to event before saving it.
 

Public Attributes

const LOG_ACTIONS = 2
 
const LOG_ALL = 1
 
const LOG_NONE = 0
 

Static Public Attributes

static $log_level = self::LOG_ACTIONS
 
static $log_time = 2592000
 

Protected Member Functions

 getDataArray ()
 A helper which makes it easier for systems to save the data.
 
 getFormatArray ()
 A helper which makes it easier for systems to save the data.
 
 save ()
 Stores the event data in the database.
 
 saveStats ()
 Add current event data to statistics counter.
 

Protected Attributes

 $content_id
 
 $content_title
 
 $id
 
 $library_name
 
 $library_version
 
 $sub_type
 
 $time
 
 $type
 

Constructor & Destructor Documentation

◆ __construct()

H5PEventBase::__construct ( $type,
$sub_type = NULL,
$content_id = NULL,
$content_title = NULL,
$library_name = NULL,
$library_version = NULL )

Adds event type, h5p library and timestamp to event before saving it.

Common event types with sub type: content, <none> – content view embed – viewed through embed code shortcode – viewed through internal shortcode edit – opened in editor delete – deleted create – created through editor create upload – created through upload update – updated through editor update upload – updated through upload upgrade – upgraded

results, <none> – view own results content – view results for content set – new results inserted or updated

settings, <none> – settings page loaded

library, <none> – loaded in editor create – new library installed update – old library updated

Parameters
string$typeName of event type
string$sub_typeName of event sub type
string$content_idIdentifier for content affected by the event
string$content_titleContent title (makes it easier to know which content was deleted etc.)
string$library_nameName of the library affected by the event
string$library_versionLibrary version

Member Function Documentation

◆ getDataArray()

H5PEventBase::getDataArray ( )
protected

A helper which makes it easier for systems to save the data.

Add all relevant properties to a assoc. array. There are no NULL values. Empty string or 0 is used instead. Used by both Drupal and WordPress.

Return values
arraywith keyed values

◆ getFormatArray()

H5PEventBase::getFormatArray ( )
protected

A helper which makes it easier for systems to save the data.

Used in WordPress.

Return values
arraywith strings

◆ save()

H5PEventBase::save ( )
abstractprotected

Stores the event data in the database.

Must be overridden by plugin.

◆ saveStats()

H5PEventBase::saveStats ( )
abstractprotected

Add current event data to statistics counter.

Must be overridden by plugin.


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