InQueryFilter
extends QueryFilter
in package
Defines a query filter that checks if the given field value is within a set of values.
Table of Contents
Properties
- $name : string
- $__log_level : int
Methods
- evaluate() : bool
- Checks if the field's value is one of the values in the given filter value array. If the field value is an array, this filter will check if the field's value matches an item in the filter value array exactly. Otherwise, this filter will check if the field's value is a substring of the filter value string.
- 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() : void
- Writes a log entry to the applicable log file
Properties
$name
public
string
$name
= 'in'
The name of this query filter. This is used to identify the filter to use during queries.
$__log_level
private
static int
$__log_level
Methods
evaluate()
Checks if the field's value is one of the values in the given filter value array. If the field value is an array, this filter will check if the field's value matches an item in the filter value array exactly. Otherwise, this filter will check if the field's value is a substring of the filter value string.
public
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 contains 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
Return values
QueryFilter —The QueryFilter object associated with the given name.
get_class_fqn()
Obtains the fully qualified name of the called class.
public
static 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
static 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()
Writes a log entry to the applicable log file
public
static log(int $level, string $message[, string $logfile = 'restapi' ]) : void
Parameters
- $level : int
-
The log level to write. This should be one of the LOG_* constants defined by syslog.
- $message : string
-
The message to write to the log file.
- $logfile : string = 'restapi'
-
The log file to write to. This must be a valid logging facility defined in the package's info.xml file.