PHP Class Habari\LogEntry

Represents a log entry
Inheritance: extends QueryRecord
Mostra file Open project: habari/system

Public Methods

Method Description
__construct ( array $paramarray = [] ) Constructor for the LogEntry class
__get ( string $name ) : mixed Overrides QueryRecord __get to implement custom object properties
__set ( string $name, mixed $value ) : mixed Overrides QueryRecord __set to implement custom object properties
default_fields ( ) : array Return the defined database columns for an Event
delete ( ) Deletes this logentry
get ( array $paramarray = [] ) : object Return a single requested log entry.
get_event_module ( ) : string Return the log entry's event module.
get_event_severity ( ) : string Return the log entry's event severity.
get_event_type ( ) : string Return the log entry's event type.
insert ( ) Insert this LogEntry data into the database
list_logentry_types ( boolean $force = false ) : array Returns an associative array of LogEntry types
list_modules ( boolean $refresh = false ) : array Returns an array of LogEntry modules
list_severities ( ) : array Return an array of Severities
list_types ( boolean $refresh = false ) : array Returns an array of LogEntry types
severity ( string $severity ) : mixed Get the integer value for the given severity, or false.
severity_name ( integer $severity ) : string Get the string representation of the severity numeric value.
type ( string $module, string $type ) : mixed Get the integer value for the given module/type, or false.

Private Methods

Method Description
severities ( $translate = true ) Defined event severities

Method Details

__construct() public method

Constructor for the LogEntry class
public __construct ( array $paramarray = [] )
$paramarray array an associative array of initial LogEntry field values

__get() public method

Overrides QueryRecord __get to implement custom object properties
public __get ( string $name ) : mixed
$name string Name of property to return
return mixed The requested field value

__set() public method

Overrides QueryRecord __set to implement custom object properties
public __set ( string $name, mixed $value ) : mixed
$name string name of property to return
$value mixed The requested field value
return mixed The requested field value

default_fields() public static method

Return the defined database columns for an Event
public static default_fields ( ) : array
return array Array of columns in the LogEntry table

delete() public method

Deletes this logentry
public delete ( )

get() public static method

$log= LogEntry::get( array( 'id' => 5 ) );
public static get ( array $paramarray = [] ) : object
$paramarray array An associated array of parameters, or a querystring
return object LogEntry The first log entry that matched the given criteria

get_event_module() public method

$log->module
public get_event_module ( ) : string
return string Human-readable event module

get_event_severity() public method

$log->severity
public get_event_severity ( ) : string
return string Human-readable event severity

get_event_type() public method

$log->type
public get_event_type ( ) : string
return string Human-readable event type

insert() public method

Insert this LogEntry data into the database
public insert ( )

list_logentry_types() public static method

Returns an associative array of LogEntry types
public static list_logentry_types ( boolean $force = false ) : array
$force boolean whether to force a refresh of the cached values
return array An array of log entry type names => integer values

list_modules() public static method

Returns an array of LogEntry modules
public static list_modules ( boolean $refresh = false ) : array
$refresh boolean Whether to refresh the cached values
return array An array of LogEntry module id => name pairs

list_severities() public static method

Return an array of Severities
public static list_severities ( ) : array
return array An array of severity ID => name pairs

list_types() public static method

Returns an array of LogEntry types
public static list_types ( boolean $refresh = false ) : array
$refresh boolean Whether to refresh the cached values
return array An array of LogEntry id => name pairs

severity() public static method

Get the integer value for the given severity, or false.
public static severity ( string $severity ) : mixed
$severity string The severity name
return mixed numeric value for the given severity, or false

severity_name() public static method

Get the string representation of the severity numeric value.
public static severity_name ( integer $severity ) : string
$severity integer The severity index.
return string The string name of the severity, or 'Unknown'.

type() public static method

Get the integer value for the given module/type, or false.
public static type ( string $module, string $type ) : mixed
$module string the module
$type string the type
return mixed numeric value for the given module/type, or false