Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
logstore_database\log\store Class Reference
Inheritance diagram for logstore_database\log\store:
tool_log\log\writer core\log\sql_reader tool_log\log\store core\log\reader

Public Member Functions

 __construct (\tool_log\log\manager $manager)
 Construct.
 
 dispose ()
 Dispose off database connection after pushing any buffered events to the database.
 
 get_config_value ($name, $default=null)
 Get a config value for the store.
 
 get_description ()
 Longer description of the log data source.
 
 get_events_select ($selectwhere, array $params, $sort, $limitfrom, $limitnum)
 Get an array of events based on the passed on params.
 
 get_events_select_count ($selectwhere, array $params)
 Get number of events present for the given select clause.
 
 get_events_select_exists (string $selectwhere, array $params)
 Get whether events are present for the given select clause.
 
 get_events_select_iterator ($selectwhere, array $params, $sort, $limitfrom, $limitnum)
 Fetch records using given criteria returning a Traversable object.
 
 get_extdb ()
 Get the external database object.
 
 get_log_event ($data)
 Returns an event from the log data.
 
 get_name ()
 Localised name of the reader.
 
 is_logging ()
 Are the new events appearing in the reader?
 
 write (\core\event\base $event)
 Write one event to the store.
 

Protected Member Functions

 init ()
 Setup the Database.
 
 insert_event_entries ($evententries)
 Insert events in bulk to the database.
 
 is_event_ignored (\core\event\base $event)
 Should the event be ignored (== not logged)?
 

Protected Attributes

moodle_database $extdb
 $extdb
 
array $includeactions = array()
 $includeactions An array of actions types to include
 
array $includelevels = array()
 $includelevels An array of education levels to include
 
bool $logguests
 $logguests true if logging guest access
 

Constructor & Destructor Documentation

◆ __construct()

logstore_database\log\store::__construct ( \tool_log\log\manager $manager)

Construct.

Parameters
tool_log\log\manager$manager

Member Function Documentation

◆ dispose()

logstore_database\log\store::dispose ( )

Dispose off database connection after pushing any buffered events to the database.

Implements tool_log\log\store.

◆ get_config_value()

logstore_database\log\store::get_config_value ( $name,
$default = null )

Get a config value for the store.

Parameters
string$nameConfig name
mixed$defaultdefault value
Return values
mixedconfig value if set, else the default value.

◆ get_description()

core\log\reader::get_description ( )
inherited

Longer description of the log data source.

Return values
string

◆ get_events_select()

logstore_database\log\store::get_events_select ( $selectwhere,
array $params,
$sort,
$limitfrom,
$limitnum )

Get an array of events based on the passed on params.

Parameters
string$selectwhereselect conditions.
array$paramsparams.
string$sortsortorder.
int$limitfromlimit constraints.
int$limitnumlimit constraints.
Return values
array|core\event\base[]array of events.

Implements core\log\sql_reader.

◆ get_events_select_count()

logstore_database\log\store::get_events_select_count ( $selectwhere,
array $params )

Get number of events present for the given select clause.

Parameters
string$selectwhereselect conditions.
array$paramsparams.
Return values
intNumber of events available for the given conditions

Implements core\log\sql_reader.

◆ get_events_select_exists()

logstore_database\log\store::get_events_select_exists ( string $selectwhere,
array $params )

Get whether events are present for the given select clause.

Parameters
string$selectwhereselect conditions.
array$paramsparams.
Return values
boolWhether events available for the given conditions

Implements core\log\sql_reader.

◆ get_events_select_iterator()

logstore_database\log\store::get_events_select_iterator ( $selectwhere,
array $params,
$sort,
$limitfrom,
$limitnum )

Fetch records using given criteria returning a Traversable object.

Note that the traversable object contains a moodle_recordset, so remember that is important that you call close() once you finish using it.

Parameters
string$selectwhere
array$params
string$sort
int$limitfrom
int$limitnum
Return values
core\dml\recordset_walk|core\event\base[]

Implements core\log\sql_reader.

◆ get_extdb()

logstore_database\log\store::get_extdb ( )

Get the external database object.

Return values
moodle_database\$extdb

◆ get_log_event()

logstore_database\log\store::get_log_event ( $data)

Returns an event from the log data.

Parameters
stdClass$dataLog data
Return values
core\event\base

Implements core\log\sql_reader.

◆ get_name()

core\log\reader::get_name ( )
inherited

Localised name of the reader.

To be used in selection for in reports.

Return values
string

◆ init()

logstore_database\log\store::init ( )
protected

Setup the Database.

Return values
bool

◆ insert_event_entries()

logstore_database\log\store::insert_event_entries ( $evententries)
protected

Insert events in bulk to the database.

Parameters
array$evententriesraw event data

◆ is_event_ignored()

logstore_database\log\store::is_event_ignored ( \core\event\base $event)
protected

Should the event be ignored (== not logged)?

Parameters
core\event\base$event
Return values
bool

◆ is_logging()

logstore_database\log\store::is_logging ( )

Are the new events appearing in the reader?

Return values
booltrue means new log events are being added, false means no new data will be added

Implements core\log\reader.

◆ write()

tool_log\log\writer::write ( \core\event\base $event)
inherited

Write one event to the store.

Parameters
core\event\base$event
Return values
void

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