PHP Класс Mmanos\Search\Query

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

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

Свойство Тип Описание
$callbacks array Any user defined callback functions to help manipulate the raw query instance.
$callbacks_executed boolean Prevents multiple executions.
$columns array The columns that should be returned.
$conditions array The search conditions for the query.
$index Mmanos\Search\Index The search index instance.
$limit integer The maximum number of records to return.
$offset integer The number of records to skip.
$query mixed The raw query used by the current search index driver.

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

Метод Описание
__construct ( Mmanos\Search\Index $index ) : void Create a new search query builder instance.
addCallback ( Closure $callback, array | string $driver = null ) : Query Add a custom callback fn to be called just before the query is executed.
count ( ) : integer Execute the current query and return the total number of results.
delete ( ) : void Execute the current query and perform delete operations on each document found.
get ( ) : array Execute the current query and return the results.
limit ( integer $limit, integer $offset ) : Query Set the "limit" and "offset" value of the query.
paginate ( integer $num = 15 ) : Illuminate\Pagination\LengthAwarePaginator Execute the current query and return a paginator for the results.
search ( string $field, mixed $value, array $options = [] ) : Query Add a basic search clause to the query.
select ( array $columns = ['*'] ) : Query Set the columns to be selected.
where ( string $field, mixed $value ) : Query Add a basic where clause to the query. A where clause filter attemtps to match the value you specify as an entire "phrase". It does not guarantee an exact match of the entire field value.
whereLocation ( float $lat, float $long, integer $distance_in_meters = 10000 ) : Query Add a geo distance where clause to the query.

Защищенные методы

Метод Описание
executeCallbacks ( ) : void Execute any callback functions. Only execute once.

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

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

Create a new search query builder instance.
public __construct ( Mmanos\Search\Index $index ) : void
$index Mmanos\Search\Index
Результат void

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

Add a custom callback fn to be called just before the query is executed.
public addCallback ( Closure $callback, array | string $driver = null ) : Query
$callback Closure
$driver array | string
Результат Query

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

Execute the current query and return the total number of results.
public count ( ) : integer
Результат integer

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

Execute the current query and perform delete operations on each document found.
public delete ( ) : void
Результат void

executeCallbacks() защищенный Метод

Execute any callback functions. Only execute once.
protected executeCallbacks ( ) : void
Результат void

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

Execute the current query and return the results.
public get ( ) : array
Результат array

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

Set the "limit" and "offset" value of the query.
public limit ( integer $limit, integer $offset ) : Query
$limit integer
$offset integer
Результат Query

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

Execute the current query and return a paginator for the results.
public paginate ( integer $num = 15 ) : Illuminate\Pagination\LengthAwarePaginator
$num integer
Результат Illuminate\Pagination\LengthAwarePaginator

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

Set the columns to be selected.
public select ( array $columns = ['*'] ) : Query
$columns array
Результат Query

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

Add a basic where clause to the query. A where clause filter attemtps to match the value you specify as an entire "phrase". It does not guarantee an exact match of the entire field value.
public where ( string $field, mixed $value ) : Query
$field string
$value mixed
Результат Query

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

Add a geo distance where clause to the query.
public whereLocation ( float $lat, float $long, integer $distance_in_meters = 10000 ) : Query
$lat float
$long float
$distance_in_meters integer
Результат Query

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

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

Any user defined callback functions to help manipulate the raw query instance.
protected array $callbacks
Результат array

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

Prevents multiple executions.
protected bool $callbacks_executed
Результат boolean

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

The columns that should be returned.
protected array $columns
Результат array

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

The search conditions for the query.
protected array $conditions
Результат array

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

The search index instance.
protected Index,Mmanos\Search $index
Результат Mmanos\Search\Index

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

The maximum number of records to return.
protected int $limit
Результат integer

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

The number of records to skip.
protected int $offset
Результат integer

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

The raw query used by the current search index driver.
protected mixed $query
Результат mixed