PHP Класс Marcelgwerder\ApiHandler\Parser

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

Открытые свойства

Свойство Тип Описание
$builder mixed The builder Instance.
$envelope boolean If the response should be in an envelope or not
$meta array The parsed meta information
$mode string The mode for the response (count,default)
$multiple boolean If the parser works on multiple datasets
$originalBuilder mixed The original builder Instance.

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

Свойство Тип Описание
$additionalFields array All fields that belong to a relation
$additionalSorts array All sorts that belong to a relation
$functionalParams All functional params
$functions array Predefined functions
$isEloquentBuilder boolean If builder is an eloquent builder or not
$isQueryBuilder boolean If builder is an query builder or not
$originalQuery Illuminate\Database\Query\Builder The original query builder instance.
$params array The http query params.
$query Illuminate\Database\Query\Builder The base query builder instance.

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

Метод Описание
__construct ( mixed $builder, array $params ) Instantiate the Parser class
parse ( mixed $options, boolean $multiple = false ) : void Parse the query parameters with the given options.
setConfigHandler ( mixed $config ) Set the config object

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

Метод Описание
getFilterParams ( ) : array | boolean Get the relevant filter parameters
getParam ( string $param ) : string | boolean Get a parameter
getRelationType ( Illuminate\Database\Eloquent\Relations\Relation $relation ) : string Determine the type of the Eloquent relation
isRelation ( Illuminate\Database\Eloquent\Model $model, string $relationName ) : boolean Check if there exists a method marked with the "@Relation" annotation on the given model.
parseConfig ( $configParam ) : void Parse the meta parameter and prepare an array of meta provider objects.
parseFields ( string $fieldsParam ) : void Parse the fields parameter and return an array of fields
parseFilter ( array $filterParams ) : void Parse the remaining filter params
parseFullTextSearch ( string $qParam, array $fullTextSearchColumns ) : void Parse the fulltext search parameter q
parseSort ( string $sortParam ) : void Parse the sort param and determine whether the sorting is ascending or descending.
parseWith ( string $withParam ) : void Parse the with parameter

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

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

Instantiate the Parser class
public __construct ( mixed $builder, array $params )
$builder mixed
$params array

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

Get the relevant filter parameters
protected getFilterParams ( ) : array | boolean
Результат array | boolean

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

Get a parameter
protected getParam ( string $param ) : string | boolean
$param string
Результат string | boolean

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

Determine the type of the Eloquent relation
protected getRelationType ( Illuminate\Database\Eloquent\Relations\Relation $relation ) : string
$relation Illuminate\Database\Eloquent\Relations\Relation
Результат string

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

Check if there exists a method marked with the "@Relation" annotation on the given model.
protected isRelation ( Illuminate\Database\Eloquent\Model $model, string $relationName ) : boolean
$model Illuminate\Database\Eloquent\Model
$relationName string
Результат boolean

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

Either for a single dataset or multiple.
public parse ( mixed $options, boolean $multiple = false ) : void
$options mixed
$multiple boolean
Результат void

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

Parse the meta parameter and prepare an array of meta provider objects.
protected parseConfig ( $configParam ) : void
Результат void

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

Parse the fields parameter and return an array of fields
protected parseFields ( string $fieldsParam ) : void
$fieldsParam string
Результат void

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

Parse the remaining filter params
protected parseFilter ( array $filterParams ) : void
$filterParams array
Результат void

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

Parse the fulltext search parameter q
protected parseFullTextSearch ( string $qParam, array $fullTextSearchColumns ) : void
$qParam string
$fullTextSearchColumns array
Результат void

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

A descending sort has a leading "-". Apply it to the query.
protected parseSort ( string $sortParam ) : void
$sortParam string
Результат void

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

Parse the with parameter
protected parseWith ( string $withParam ) : void
$withParam string
Результат void

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

Set the config object
public setConfigHandler ( mixed $config )
$config mixed

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

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

All fields that belong to a relation
protected array $additionalFields
Результат array

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

All sorts that belong to a relation
protected array $additionalSorts
Результат array

$builder публичное свойство

The builder Instance.
public mixed $builder
Результат mixed

$envelope публичное свойство

If the response should be in an envelope or not
public bool $envelope
Результат boolean

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

All functional params
protected $functionalParams

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

Predefined functions
protected array $functions
Результат array

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

If builder is an eloquent builder or not
protected bool $isEloquentBuilder
Результат boolean

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

If builder is an query builder or not
protected bool $isQueryBuilder
Результат boolean

$meta публичное свойство

The parsed meta information
public array $meta
Результат array

$mode публичное свойство

The mode for the response (count,default)
public string $mode
Результат string

$multiple публичное свойство

If the parser works on multiple datasets
public bool $multiple
Результат boolean

$originalBuilder публичное свойство

The original builder Instance.
public mixed $originalBuilder
Результат mixed

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

The original query builder instance.
protected Builder,Illuminate\Database\Query $originalQuery
Результат Illuminate\Database\Query\Builder

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

The http query params.
protected array $params
Результат array

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

The base query builder instance.
protected Builder,Illuminate\Database\Query $query
Результат Illuminate\Database\Query\Builder