PHP Класс phpbb\log\log

Наследование: implements phpbb\log\log_interface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$auth phpbb\auth\auth Auth object
$db phpbb\db\driver\driver Database object
$disabled_types array An array with the disabled log types. Logs of such types will not be added when add() is called.
$dispatcher phpbb\event\dispatcher_interface Event dispatcher object
$entry_count integer Keeps the total log count of the last call to get_logs()
$is_in_admin boolean If set, administrative user profile links will be returned and messages will not be censored.
$last_page_offset integer Keeps the offset of the last valid page of the last call to get_logs()
$log_table string The table we use to store our logs.
$php_ext string PHP Extension
$phpbb_admin_path string Admin root path
$phpbb_root_path string phpBB root path
$user phpbb\user User object

Открытые методы

Метод Описание
__construct ( phpbb\db\driver\driver_interface $db, phpbb\user $user, phpbb\auth\auth $auth, phpbb\event\dispatcher_interface $phpbb_dispatcher, string $phpbb_root_path, string $relative_admin_path, string $php_ext, string $log_table ) Constructor
add ( $mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = [] ) {@inheritDoc}
delete ( $mode, $conditions = [] ) {@inheritDoc}
disable ( $type = '' ) {@inheritDoc}
enable ( $type = '' ) {@inheritDoc}
get_is_admin ( ) : boolean Returns the is_in_admin option
get_log_count ( ) {@inheritDoc}
get_logs ( $mode, $count_logs = true, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by = 'l.log_time DESC', $keywords = '' ) {@inheritDoc}
get_valid_offset ( ) {@inheritDoc}
is_enabled ( $type = '' ) {@inheritDoc}
set_is_admin ( boolean $is_in_admin ) : null Set is_in_admin in order to return administrative user profile links in get_logs()
set_log_table ( string $log_table ) : null Set table name

Защищенные методы

Метод Описание
generate_sql_keyword ( string $keywords, string $table_alias = 'l.', string $statement_operator = 'AND' ) : string Generates a sql condition for the specified keywords
get_reportee_data ( array $reportee_ids ) : array Get the data for all reportee from the database
get_topic_auth ( array $topic_ids ) : array Determine whether the user is allowed to read and/or moderate the forum of the topic

Описание методов

__construct() публичный метод

Constructor
public __construct ( phpbb\db\driver\driver_interface $db, phpbb\user $user, phpbb\auth\auth $auth, phpbb\event\dispatcher_interface $phpbb_dispatcher, string $phpbb_root_path, string $relative_admin_path, string $php_ext, string $log_table )
$db phpbb\db\driver\driver_interface Database object
$user phpbb\user User object
$auth phpbb\auth\auth Auth object
$phpbb_dispatcher phpbb\event\dispatcher_interface Event dispatcher
$phpbb_root_path string Root path
$relative_admin_path string Relative admin root path
$php_ext string PHP Extension
$log_table string Name of the table we use to store our logs

add() публичный метод

{@inheritDoc}
public add ( $mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = [] )

delete() публичный метод

{@inheritDoc}
public delete ( $mode, $conditions = [] )

disable() публичный метод

{@inheritDoc}
public disable ( $type = '' )

enable() публичный метод

{@inheritDoc}
public enable ( $type = '' )

generate_sql_keyword() защищенный метод

Generates a sql condition for the specified keywords
protected generate_sql_keyword ( string $keywords, string $table_alias = 'l.', string $statement_operator = 'AND' ) : string
$keywords string The keywords the user specified to search for
$table_alias string The alias of the logs' table ('l.' by default)
$statement_operator string The operator used to prefix the statement ('AND' by default)
Результат string Returns the SQL condition searching for the keywords

get_is_admin() публичный метод

Returns the is_in_admin option
public get_is_admin ( ) : boolean
Результат boolean

get_log_count() публичный метод

{@inheritDoc}
public get_log_count ( )

get_logs() публичный метод

{@inheritDoc}
public get_logs ( $mode, $count_logs = true, $limit, $offset, $forum_id, $topic_id, $user_id, $log_time, $sort_by = 'l.log_time DESC', $keywords = '' )

get_reportee_data() защищенный метод

Get the data for all reportee from the database
protected get_reportee_data ( array $reportee_ids ) : array
$reportee_ids array Array with the user ids of the reportees
Результат array Returns an array with the reportee data

get_topic_auth() защищенный метод

Determine whether the user is allowed to read and/or moderate the forum of the topic
protected get_topic_auth ( array $topic_ids ) : array
$topic_ids array Array with the topic ids
Результат array Returns an array with two keys 'm_' and 'read_f' which are also an array of topic_id => forum_id sets when the permissions are given. Sample: array( 'permission' => array( topic_id => forum_id ), ),

get_valid_offset() публичный метод

{@inheritDoc}
public get_valid_offset ( )

is_enabled() публичный метод

{@inheritDoc}
public is_enabled ( $type = '' )

set_is_admin() публичный метод

Set is_in_admin in order to return administrative user profile links in get_logs()
public set_is_admin ( boolean $is_in_admin ) : null
$is_in_admin boolean Are we called from within the acp?
Результат null

set_log_table() публичный метод

Set table name
public set_log_table ( string $log_table ) : null
$log_table string Can overwrite the table to use for the logs
Результат null

Описание свойств

$auth защищенное свойство

Auth object
protected auth,phpbb\auth $auth
Результат phpbb\auth\auth

$db защищенное свойство

Database object
protected driver,phpbb\db\driver $db
Результат phpbb\db\driver\driver

$disabled_types защищенное свойство

An array with the disabled log types. Logs of such types will not be added when add() is called.
protected array $disabled_types
Результат array

$dispatcher защищенное свойство

Event dispatcher object
protected dispatcher_interface,phpbb\event $dispatcher
Результат phpbb\event\dispatcher_interface

$entry_count защищенное свойство

Keeps the total log count of the last call to get_logs()
protected int $entry_count
Результат integer

$is_in_admin защищенное свойство

If set, administrative user profile links will be returned and messages will not be censored.
protected bool $is_in_admin
Результат boolean

$last_page_offset защищенное свойство

Keeps the offset of the last valid page of the last call to get_logs()
protected int $last_page_offset
Результат integer

$log_table защищенное свойство

The table we use to store our logs.
protected string $log_table
Результат string

$php_ext защищенное свойство

PHP Extension
protected string $php_ext
Результат string

$phpbb_admin_path защищенное свойство

Admin root path
protected string $phpbb_admin_path
Результат string

$phpbb_root_path защищенное свойство

phpBB root path
protected string $phpbb_root_path
Результат string

$user защищенное свойство

User object
protected user,phpbb $user
Результат phpbb\user