PHP Class Search\Model\Filter\Base

Inheritance: use trait Cake\Core\InstanceConfigTrait
Show file Open project: friendsofcake/search Class Usage Examples

Protected Properties

Property Type Description
$_args array Set the data to process on.
$_defaultConfig array Default configuration.
$_manager Search\Manager The parent Search Manager.
$_query Cake\ORM\Query Query object.

Public Methods

Method Description
__construct ( string $name, Manager $manager, array $config = [] ) Constructor.
args ( array $value = null ) : array | null Get / Set the args.
field ( ) : string | array Get the database field name.
fields ( ) : array Get the database field name(s) as an array.
filterEmpty ( ) : boolean Check if empty value for name in query string should be filtered out.
manager ( ) : Manager Get the manager.
name ( ) : string Get the field name from HTTP GET query string.
present ( ) : boolean Check if the name is present in the arguments from HTTP GET.
process ( ) : void Modify the actual query object and append conditions based on the subclass business rules and type.
query ( Query $value = null ) : void | Query Get / Set the query object.
skip ( ) : boolean Checks whether this finder should be skipped.
valid ( ) : boolean Valid method.
validate ( array $value = null ) : array | null Get / Set the validation rules.
value ( ) : mixed Get the value of the "name" from HTTP GET arguments.

Method Details

__construct() public method

By default the name of the HTTP GET query argument will be assumed the field name in the database as well.
public __construct ( string $name, Manager $manager, array $config = [] )
$name string Name.
$manager Search\Manager Manager.
$config array Config.

args() public method

Get / Set the args.
public args ( array $value = null ) : array | null
$value array Value.
return array | null

field() public method

Get the database field name.
public field ( ) : string | array
return string | array

fields() public method

Get the database field name(s) as an array.
public fields ( ) : array
return array

filterEmpty() public method

Check if empty value for name in query string should be filtered out.
public filterEmpty ( ) : boolean
return boolean

manager() public method

Get the manager.
public manager ( ) : Manager
return Search\Manager

name() public method

Get the field name from HTTP GET query string.
public name ( ) : string
return string

present() public method

Check if the name is present in the arguments from HTTP GET.
public present ( ) : boolean
return boolean

process() abstract public method

Modify the actual query object and append conditions based on the subclass business rules and type.
abstract public process ( ) : void
return void

query() public method

Get / Set the query object.
public query ( Query $value = null ) : void | Query
$value Cake\ORM\Query Value.
return void | Cake\ORM\Query

skip() public method

Checks whether this finder should be skipped.
public skip ( ) : boolean
return boolean

valid() public method

Valid method.
public valid ( ) : boolean
return boolean

validate() public method

Get / Set the validation rules.
public validate ( array $value = null ) : array | null
$value array Value.
return array | null

value() public method

Get the value of the "name" from HTTP GET arguments.
public value ( ) : mixed
return mixed

Property Details

$_args protected property

Set the data to process on.
protected array $_args
return array

$_defaultConfig protected property

Default configuration.
protected array $_defaultConfig
return array

$_manager protected property

The parent Search Manager.
protected Manager,Search $_manager
return Search\Manager

$_query protected property

Query object.
protected Query,Cake\ORM $_query
return Cake\ORM\Query