pfSense-pkg-RESTAPI

QueryFilter
in package
uses BaseTraits

AbstractYes

Defines a query filter that can be used to further filter a ModelSet's 'model_objects'.

Table of Contents

Properties

$name  : string

Methods

evaluate()  : bool
Defines the logic used for evaluating filter matches during a query.
get_all_names()  : array<string|int, mixed>
Obtains an array of all available QueryFilter names.
get_by_name()  : QueryFilter
Obtains the QueryFilter object associated with the given name.
get_class_fqn()  : string
Obtains the fully qualified name of the called class.
get_class_shortname()  : string
Obtains the shortname of the called class.
get_classes_in_namespace()  : array<string|int, mixed>
Obtains all classes associated with this class's current namespace.
log_error()  : void
Logs an error to the syslog.

Properties

$name

public string $name

The name of this query filter. This is used to identify the filter to use during queries.

Methods

evaluate()

Defines the logic used for evaluating filter matches during a query.

public abstract evaluate(mixed $field_value, mixed $filter_value) : bool
Parameters
$field_value : mixed

The value of the field being used to filter.

$filter_value : mixed

The value of the filter criteria to evaluate against.

Return values
bool

true if the field_value matches the filter_value, false otherwise.

get_all_names()

Obtains an array of all available QueryFilter names.

public static get_all_names() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of all available QueryFilter names.

get_by_name()

Obtains the QueryFilter object associated with the given name.

public static get_by_name(string $name) : QueryFilter
Parameters
$name : string

The name of the QueryFilter to obtain.

Tags
throws
NotFoundError

If the given name does not correspond to a valid QueryFilter class.

Return values
QueryFilter

The QueryFilter object associated with the given name.

get_class_fqn()

Obtains the fully qualified name of the called class.

public get_class_fqn() : string
Return values
string

The FQN for this object's class.

get_class_shortname()

Obtains the shortname of the called class.

public get_class_shortname() : string
Return values
string

The shortname for this object's class.

get_classes_in_namespace()

Obtains all classes associated with this class's current namespace.

public get_classes_in_namespace([bool $shortnames = false ]) : array<string|int, mixed>
Parameters
$shortnames : bool = false
Return values
array<string|int, mixed>

An array of classes currently in this object's namespace

log_error()

Logs an error to the syslog.

public static log_error(string $message) : void
Parameters
$message : string

The error message to write to the syslog


        
On this page

Search results