PHP 클래스 Give_Logging, Give

A general use class for logging events and errors.
부터: 1.0
파일 보기 프로젝트 열기: wordimpress/give 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ) : void Class Constructor
add ( string $title = '', string $message = '', integer $parent, string $type = null ) : integer Create new log entry
delete_logs ( integer $object_id, string $type = null, array $meta_query = null ) : void Delete Logs
get_connected_logs ( array $args = [] ) : array | false Retrieve all connected logs
get_log_count ( integer $object_id, string $type = null, array $meta_query = null, array $date_query = null ) : integer Retrieve Log Count
get_logs ( integer $object_id, string $type = null, integer $paged = null ) : array Get Logs
insert_log ( array $log_data = [], array $log_meta = [] ) : integer Stores a log entry
log_types ( ) : array Log Types
register_post_type ( ) : void Log Post Type
register_taxonomy ( ) : void Log Type Taxonomy
update_log ( array $log_data = [], array $log_meta = [] ) : boolean Update and existing log item
valid_type ( string $type ) : boolean Check if a log type is valid

메소드 상세

__construct() 공개 메소드

Set up the Give Logging Class.
부터: 1.0
public __construct ( ) : void
리턴 void

add() 공개 메소드

This is just a simple and fast way to log something. Use $this->insert_log() if you need to store custom meta data.
부터: 1.0
public add ( string $title = '', string $message = '', integer $parent, string $type = null ) : integer
$title string Log entry title. Default is empty.
$message string Log entry message. Default is empty.
$parent integer Log entry parent. Default is 0.
$type string Log type. Default is null.
리턴 integer Log ID.

delete_logs() 공개 메소드

Remove log entries connected to particular object ID.
부터: 1.0
public delete_logs ( integer $object_id, string $type = null, array $meta_query = null ) : void
$object_id integer Log object ID. Default is 0.
$type string Log type. Default is null.
$meta_query array Log meta query. Default is null.
리턴 void

get_connected_logs() 공개 메소드

Used for retrieving logs related to particular items, such as a specific donation.
부터: 1.0
public get_connected_logs ( array $args = [] ) : array | false
$args array Query arguments.
리턴 array | false Array if logs were found, false otherwise.

get_log_count() 공개 메소드

Retrieves number of log entries connected to particular object ID.
부터: 1.0
public get_log_count ( integer $object_id, string $type = null, array $meta_query = null, array $date_query = null ) : integer
$object_id integer Log object ID. Default is 0.
$type string Log type. Default is null.
$meta_query array Log meta query. Default is null.
$date_query array Log data query. Default is null.
리턴 integer Log count.

get_logs() 공개 메소드

Retrieves log items for a particular object ID.
부터: 1.0
public get_logs ( integer $object_id, string $type = null, integer $paged = null ) : array
$object_id integer Log object ID. Default is 0.
$type string Log type. Default is null.
$paged integer Page number Default is null.
리턴 array An array of the connected logs.

insert_log() 공개 메소드

Stores a log entry
부터: 1.0
public insert_log ( array $log_data = [], array $log_meta = [] ) : integer
$log_data array Log entry data.
$log_meta array Log entry meta.
리턴 integer The ID of the newly created log item.

log_types() 공개 메소드

Sets up the default log types and allows for new ones to be created.
부터: 1.0
public log_types ( ) : array
리턴 array $terms

register_post_type() 공개 메소드

Registers the 'give_log' Post Type.
부터: 1.0
public register_post_type ( ) : void
리턴 void

register_taxonomy() 공개 메소드

Registers the "Log Type" taxonomy. Used to determine the type of log entry.
부터: 1.0
public register_taxonomy ( ) : void
리턴 void

update_log() 공개 메소드

Update and existing log item
부터: 1.0
public update_log ( array $log_data = [], array $log_meta = [] ) : boolean
$log_data array Log entry data.
$log_meta array Log entry meta.
리턴 boolean True if successful, false otherwise.

valid_type() 공개 메소드

Checks to see if the specified type is in the registered list of types.
부터: 1.0
public valid_type ( string $type ) : boolean
$type string Log type.
리턴 boolean Whether log type is valid.