PHP Класс Search\Manager

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_collection string Active filter collection.
$_filters array Filter collection and their filters
$_repository Repository

Открытые методы

Метод Описание
__call ( string $method, array $args ) Magic method to add filters using custom types.
__construct ( Cake\Datasource\RepositoryInterface $repository ) Constructor
add ( string $name, string $filter, array $options = [] ) Adds a new filter to the active collection.
all ( ) : array Return all configured types.
boolean ( string $name, array $config = [] ) boolean method
callback ( string $name, array $config = [] ) callback method
collection ( string | null $name = null ) : mixed Sets or gets the filter collection name.
compare ( string $name, array $config = [] ) compare method
custom ( string $name, array $config = [] ) custom method
finder ( string $name, array $config = [] ) finder method
getFilters ( string $collection = 'default' ) : array Gets all filters in a given collection.
like ( string $name, array $config = [] ) like method
loadFilter ( string $name, string $filter, array $options = [] ) : Base Loads a search filter.
remove ( string $name ) : void Removes filter from the active collection.
repository ( ) : Cake\Datasource\RepositoryInterface Return repository instance.
table ( ) : Table Return Table
value ( string $name, array $config = [] ) value method

Описание методов

__call() публичный Метод

Magic method to add filters using custom types.
public __call ( string $method, array $args )
$method string Method name.
$args array Arguments.

__construct() публичный Метод

Constructor
public __construct ( Cake\Datasource\RepositoryInterface $repository )
$repository Cake\Datasource\RepositoryInterface Repository

add() публичный Метод

Adds a new filter to the active collection.
public add ( string $name, string $filter, array $options = [] )
$name string Field name.
$filter string Filter name.
$options array Filter options.

all() публичный Метод

Return all configured types.
public all ( ) : array
Результат array Config

boolean() публичный Метод

boolean method
public boolean ( string $name, array $config = [] )
$name string Name
$config array Config

callback() публичный Метод

callback method
public callback ( string $name, array $config = [] )
$name string Name
$config array Config

collection() публичный Метод

Sets or gets the filter collection name.
public collection ( string | null $name = null ) : mixed
$name string | null Name of the active filter collection to set.
Результат mixed Returns $this or the name of the active collection if no $name was provided.

compare() публичный Метод

compare method
public compare ( string $name, array $config = [] )
$name string Name
$config array Config

custom() публичный Метод

custom method
public custom ( string $name, array $config = [] )
$name string Name
$config array Config

finder() публичный Метод

finder method
public finder ( string $name, array $config = [] )
$name string Name
$config array Config

getFilters() публичный Метод

Gets all filters in a given collection.
public getFilters ( string $collection = 'default' ) : array
$collection string Name of the filter collection.
Результат array Array of filter instances.

like() публичный Метод

like method
public like ( string $name, array $config = [] )
$name string Name
$config array Config

loadFilter() публичный Метод

Loads a search filter.
public loadFilter ( string $name, string $filter, array $options = [] ) : Base
$name string Name of the field
$filter string Filter name
$options array Filter options.
Результат Search\Model\Filter\Base

remove() публичный Метод

Removes filter from the active collection.
public remove ( string $name ) : void
$name string Name of the filter to be removed.
Результат void

repository() публичный Метод

Return repository instance.
public repository ( ) : Cake\Datasource\RepositoryInterface
Результат Cake\Datasource\RepositoryInterface Repository Instance

table() публичный Метод

Return Table
Устаревший: Use repository() instead.
public table ( ) : Table
Результат Cake\ORM\Table Table Instance

value() публичный Метод

value method
public value ( string $name, array $config = [] )
$name string Name
$config array Config

Описание свойств

$_collection защищенное свойство

Active filter collection.
protected string $_collection
Результат string

$_filters защищенное свойство

Filter collection and their filters
protected array $_filters
Результат array

$_repository защищенное свойство

Repository
protected $_repository