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

Public Member Functions

 __construct ($id=NULL)
 Contruct set logger.
 add_partition ()
 Add new partition for logs.
 remove_old_partitions ()
 Remove partitions for log which are more than 31 days old.
 get_all_users_logs ($user_id, $offset, $limit)
 Gets all users logs with limit.
 get_all_object_logs ($table_name, $object_id, $offset, $limit)
 Gets all objects logs with limit.
 get_all_logs ($offset, $limit, $filter_sql= '')
 Gets all logs with limit.
 count_all_logs ($filter_sql=array())
 Gets number of logs.
 count_all_users_logs ($user_id)
 Gets number of users logs.
 count_all_object_logs ($table_name, $object_id)
 Gets number of object logs.
 get_object_last_modification ($table_name, $object_id)
 Gets last modification time of object.

Static Public Member Functions

static create_table ()
 Creates table for logs.

Public Attributes

const ACTION_ADD = 1
 Logger action for adding record to the table.
const ACTION_DELETE = 2
 Logger action for adding record to the table.
const ACTION_UPDATE = 3
 Logger action for updating record to the table.

Protected Attributes

 $belongs_to = array('user')

Constructor & Destructor Documentation

Log_Model::__construct (   $id = NULL)

Contruct set logger.

Parameters
int$id

Member Function Documentation

Log_Model::add_partition ( )

Add new partition for logs.

Author
Ondřej Fibich
See Also
Scheduler_Controller::logs_partitions_daily()
Log_Model::count_all_logs (   $filter_sql = array())

Gets number of logs.

Parameters
array$filter_sqlFilter for where contition
Returns
int
Log_Model::count_all_object_logs (   $table_name,
  $object_id 
)

Gets number of object logs.

Parameters
string$table_name
int$object_id
Returns
int
Log_Model::count_all_users_logs (   $user_id)

Gets number of users logs.

Parameters
int$user_id
Returns
int
static Log_Model::create_table ( )
static

Creates table for logs.

Author
Ondřej Fibich
Log_Model::get_all_logs (   $offset,
  $limit,
  $filter_sql = '' 
)

Gets all logs with limit.

Parameters
int$offset
int$limit
array$filter_sqlFilter for where contition
Returns
Mysql_Result
Log_Model::get_all_object_logs (   $table_name,
  $object_id,
  $offset,
  $limit 
)

Gets all objects logs with limit.

Parameters
string$table_name
int$object_id
int$offset
int$limit
Returns
Mysql_Result
Log_Model::get_all_users_logs (   $user_id,
  $offset,
  $limit 
)

Gets all users logs with limit.

Parameters
int$offset
int$limit
int$user_id
Returns
Mysql_Result
Log_Model::get_object_last_modification (   $table_name,
  $object_id 
)

Gets last modification time of object.

Parameters
string$table_name
int$object_id
Returns
string
Log_Model::remove_old_partitions ( )

Remove partitions for log which are more than 31 days old.

Author
Ondřej Fibich
See Also
Scheduler_Controller::logs_partitions_daily()

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