PHP 클래스 Marcelgwerder\ApiHandler\Parser

파일 보기 프로젝트 열기: marcelgwerder/laravel-api-handler 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

보호된 프로퍼티들

프로퍼티 타입 설명
$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