MySLP_History_Table
in package
Class MySLP_History_Table
Table of Contents
Constants
- TABLE_SLUG : string = 'myslp_logger'
Properties
- $blog_filter : int|null
- $current_page : int|null
- $date_filter : string|null
- $logs_per_page : int
- $search : string|null
- $table_name : string
Methods
- __construct() : mixed
- MySLP_History_Table constructor.
- date_filter() : string
- display() : string
- Dislpay the table.
- get_records() : array<string|int, mixed>
- Fetch records from the history table.
- get_rows_data() : array<int, array<string, mixed>>
- Return raw rows as an array of associative arrays for API consumption.
- get_table_name() : string
- Get the history table name.
- pagination() : string|void
- search() : string
- search_help() : string
- Show search help.
- add_where() : string
- get_all_logs() : string|null
- get_dates() : array<string|int, mixed>|object|array<string|int, stdClass>|null
- get_row() : string|null
- get_table_footer() : string
- get_table_header() : string
- no_item() : string|null
- render_data() : string
- Render the HTML rows for the legacy table output.
- scrub_description() : string
- Scrub the leading metadata header from the description when present.
Constants
TABLE_SLUG
private
string
TABLE_SLUG
= 'myslp_logger'
Properties
$blog_filter
private
int|null
$blog_filter
$current_page
private
int|null
$current_page
$date_filter
private
string|null
$date_filter
$logs_per_page
private
int
$logs_per_page
= 50
$search
private
string|null
$search
$table_name
private
string
$table_name
Methods
__construct()
MySLP_History_Table constructor.
public
__construct([array<string|int, mixed> $data = array() ]) : mixed
Parameters
- $data : array<string|int, mixed> = array()
date_filter()
public
date_filter() : string
Return values
stringdisplay()
Dislpay the table.
public
display() : string
Return values
stringget_records()
Fetch records from the history table.
public
static get_records([string $since = '1970-01-01 00:00:00' ][, string $like = '' ]) : array<string|int, mixed>
Parameters
- $since : string = '1970-01-01 00:00:00'
- $like : string = ''
Return values
array<string|int, mixed>get_rows_data()
Return raw rows as an array of associative arrays for API consumption.
public
get_rows_data() : array<int, array<string, mixed>>
Return values
array<int, array<string, mixed>>get_table_name()
Get the history table name.
public
static get_table_name() : string
Return values
stringpagination()
public
pagination() : string|void
Return values
string|voidsearch()
public
search() : string
Return values
stringsearch_help()
Show search help.
public
search_help() : string
Return values
stringadd_where()
private
add_where() : string
Return values
stringget_all_logs()
private
get_all_logs() : string|null
Return values
string|nullget_dates()
private
get_dates() : array<string|int, mixed>|object|array<string|int, stdClass>|null
Return values
array<string|int, mixed>|object|array<string|int, stdClass>|nullget_row()
private
get_row() : string|null
Return values
string|nullget_table_footer()
private
get_table_footer() : string
Return values
stringget_table_header()
private
get_table_header() : string
Return values
stringno_item()
private
no_item() : string|null
Return values
string|nullrender_data()
Render the HTML rows for the legacy table output.
private
render_data(array<int, array<string, mixed>> $data) : string
Parameters
- $data : array<int, array<string, mixed>>
Return values
stringscrub_description()
Scrub the leading metadata header from the description when present.
private
scrub_description(string $html) : string
Rules (per issue description):
- Only if the description starts with the exact pattern beginning at the start: Blog ID:
- Remove everything from that start through the first
that follows the exact string Customer Name: - Use exact tag/label casing; only
variant. - If a result is empty after trimming, the caller may skip the row.
Parameters
- $html : string