FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | List of all members
Log_queue_Model Class Reference
Inheritance diagram for Log_queue_Model:
ORM

Public Member Functions

 __construct ($id=NULL)
 count_all_logs ($filter_sql= '')
 Counts filtered logs.
 get_all_logs ($limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'asc', $filter_sql= '')
 Gets filtered connection requests.

Static Public Member Functions

static get_types ($translate=TRUE)
 Gets types.
static get_type_name ($type, $translated=TRUE)
 Get name of log type.
static get_type_colors ()
 Gets type colors.
static get_type_color ($type)
 Gets color of a type.
static get_states ($translate=TRUE)
 Gets states.
static get_state ($state, $translate=TRUE)
 Gets state.
static ferror ($description, $exception_backtrace=NULL, $created_at=NULL)
 Creates new fatal error log.
static error ($description, $exception_backtrace=NULL, $created_at=NULL)
 Creates new error log.
static warn ($description, $exception_backtrace=NULL, $created_at=NULL)
 Creates new warning log.
static info ($description, $exception_backtrace=NULL, $created_at=NULL)
 Creates new info log.

Public Attributes

const STATE_NEW = 0
 New state (log is unclosed)
const STATE_CLOSED = 1
 Closed state (log is closed by an user)
const TYPE_FATAL_ERROR = 0
 Fatal error type.
const TYPE_ERROR = 1
 Error type.
const TYPE_WARNING = 2
 Warning type.
const TYPE_INFO = 3
 Information type.

Static Protected Member Functions

static log ($type, $description, $exception_backtrace=NULL, $created_at=NULL)
 Creates new log.

Protected Attributes

 $belongs_to

Member Function Documentation

Log_queue_Model::count_all_logs (   $filter_sql = '')

Counts filtered logs.

Parameters
string$filter_sqlSQL filter
Returns
integer Count
static Log_queue_Model::error (   $description,
  $exception_backtrace = NULL,
  $created_at = NULL 
)
static

Creates new error log.

Parameters
string$descriptionDecription of error
Exception$exception_backtrace[optional - empty by default]
string$created_at[optional - default current datetime]
Returns
Log_queue_Model Created model
static Log_queue_Model::ferror (   $description,
  $exception_backtrace = NULL,
  $created_at = NULL 
)
static

Creates new fatal error log.

Parameters
string$descriptionDecription of error
Exception$exception_backtrace[optional - empty by default]
string$created_at[optional - default current datetime]
Returns
Log_queue_Model Created model
Log_queue_Model::get_all_logs (   $limit_from = 0,
  $limit_results = 50,
  $order_by = 'id',
  $order_by_direction = 'asc',
  $filter_sql = '' 
)

Gets filtered connection requests.

Parameters
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
string$filter_sqlSQL filter
Returns
Mysql_Result
static Log_queue_Model::get_state (   $state,
  $translate = TRUE 
)
static

Gets state.

Parameters
int$state
boolean$translateTranslate messages?
Returns
array
static Log_queue_Model::get_states (   $translate = TRUE)
static

Gets states.

Parameters
boolean$translateTranslate messages?
Returns
array
static Log_queue_Model::get_type_color (   $type)
static

Gets color of a type.

Parameters
int$typeLog type
Returns
string Color
static Log_queue_Model::get_type_colors ( )
static

Gets type colors.

Returns
array
static Log_queue_Model::get_type_name (   $type,
  $translated = TRUE 
)
static

Get name of log type.

Parameters
integer$typeType of log
boolean$translateTranslate messages?
Returns
string Name
static Log_queue_Model::get_types (   $translate = TRUE)
static

Gets types.

Parameters
boolean$translateTranslate messages?
Returns
array
static Log_queue_Model::info (   $description,
  $exception_backtrace = NULL,
  $created_at = NULL 
)
static

Creates new info log.

Parameters
string$descriptionDecription of error
Exception$exception_backtrace[optional - empty by default]
string$created_at[optional - default current datetime]
Returns
Log_queue_Model Created model
static Log_queue_Model::log (   $type,
  $description,
  $exception_backtrace = NULL,
  $created_at = NULL 
)
staticprotected

Creates new log.

Parameters
type$typeType of error
string$descriptionDecription of error
Exception$exception_backtrace[optional - empty by default]
string$created_at[optional - default current datetime]
Returns
Log_queue_Model Created model or null on error during saving
static Log_queue_Model::warn (   $description,
  $exception_backtrace = NULL,
  $created_at = NULL 
)
static

Creates new warning log.

Parameters
string$descriptionDecription of error
Exception$exception_backtrace[optional - empty by default]
string$created_at[optional - default current datetime]
Returns
Log_queue_Model Created model

Member Data Documentation

Log_queue_Model::$belongs_to
protected
Initial value:
array
(
'comments_thread', 'closed_by_user' => 'user'
)

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