Post extends Query
Queries posts.
Table of Contents
- $aliases : array<string|int, mixed>
- Parameter aliases.
- $args : array<string|int, mixed>
- WP query arguments.
- $executed : bool
- Is query already executed?
- $model : object
- Model object.
- __construct() : mixed
- Class constructor.
- delete() : mixed
- Deletes objects.
- delete_by_id() : mixed
- Deletes object by ID.
- filter() : object
- Sets query filters.
- get() : object
- Gets objects.
- get_args() : array<string|int, mixed>
- Gets WP query arguments.
- get_by_id() : object
- Gets object by ID.
- get_count() : int
- Gets object count.
- get_first() : object
- Gets the first object.
- get_first_id() : int
- Gets the first object ID.
- get_ids() : array<string|int, mixed>
- Gets object IDs.
- limit() : object
- Limits the number of results.
- offset() : object
- Skips the number of results.
- order() : object
- Sets query order.
- paginate() : object
- Skips the number of pages.
- search() : object
- Sets search filter.
- serialize() : array<string|int, mixed>
- Gets objects array.
- set_args() : object
- Sets WP query arguments.
- trash() : mixed
- Trashes objects.
- trash_by_id() : mixed
- Trashes object by ID.
- boot() : mixed
- Bootstraps query properties.
- get_alias() : string
- Gets parameter alias.
- get_operator() : string
- Gets comparison operator.
- get_results() : array<string|int, mixed>
- Gets query results.
- set_property() : mixed
- Sets a property value.
Properties
$aliases
Parameter aliases.
protected
array<string|int, mixed>
$aliases
= []
$args
WP query arguments.
protected
array<string|int, mixed>
$args
= []
$executed
Is query already executed?
protected
bool
$executed
= false
$model
Model object.
protected
object
$model
Methods
__construct()
Class constructor.
public
__construct([array<string|int, mixed> $args = [] ]) : mixed
Parameters
- $args : array<string|int, mixed> = []
-
Query arguments.
Return values
mixed —delete()
Deletes objects.
public
final delete() : mixed
Return values
mixed —delete_by_id()
Deletes object by ID.
public
final delete_by_id(int $id) : mixed
Parameters
- $id : int
-
Object ID.
Return values
mixed —filter()
Sets query filters.
public
filter(array<string|int, mixed> $criteria) : object
Parameters
- $criteria : array<string|int, mixed>
-
Filter criteria.
Return values
object —get()
Gets objects.
public
final get() : object
Return values
object —get_args()
Gets WP query arguments.
public
final get_args() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_by_id()
Gets object by ID.
public
final get_by_id(int $id) : object
Parameters
- $id : int
-
Object ID.
Return values
object —get_count()
Gets object count.
public
final get_count() : int
Return values
int —get_first()
Gets the first object.
public
final get_first() : object
Return values
object —get_first_id()
Gets the first object ID.
public
final get_first_id() : int
Return values
int —get_ids()
Gets object IDs.
public
get_ids() : array<string|int, mixed>
Return values
array<string|int, mixed> —limit()
Limits the number of results.
public
limit(int $number) : object
Parameters
- $number : int
-
Objects number.
Return values
object —offset()
Skips the number of results.
public
offset(int $number) : object
Parameters
- $number : int
-
Objects number.
Return values
object —order()
Sets query order.
public
order(array<string|int, mixed> $criteria) : object
Parameters
- $criteria : array<string|int, mixed>
-
Order criteria.
Return values
object —paginate()
Skips the number of pages.
public
paginate(int $number) : object
Parameters
- $number : int
-
Page number.
Return values
object —search()
Sets search filter.
public
search(string $query) : object
Parameters
- $query : string
-
Search query.
Return values
object —serialize()
Gets objects array.
public
final serialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —set_args()
Sets WP query arguments.
public
final set_args(array<string|int, mixed> $args) : object
Parameters
- $args : array<string|int, mixed>
-
Query arguments.
Return values
object —trash()
Trashes objects.
public
final trash() : mixed
Return values
mixed —trash_by_id()
Trashes object by ID.
public
final trash_by_id(int $id) : mixed
Parameters
- $id : int
-
Object ID.
Return values
mixed —boot()
Bootstraps query properties.
protected
boot() : mixed
Return values
mixed —get_alias()
Gets parameter alias.
protected
final get_alias(string $path) : string
Parameters
- $path : string
-
Alias path.
Return values
string —get_operator()
Gets comparison operator.
protected
final get_operator(string $alias) : string
Parameters
- $alias : string
-
Operator alias.
Return values
string —get_results()
Gets query results.
protected
final get_results(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
-
Query arguments.
Return values
array<string|int, mixed> —set_property()
Sets a property value.
protected
final set_property(string $name, mixed $value[, string $prefix = '' ]) : mixed
Parameters
- $name : string
-
Property name.
- $value : mixed
-
Property value.
- $prefix : string = ''
-
Method prefix.