PHP 클래스 Isswp101\Persimmon\QueryBuilder\Filters\Filter

파일 보기 프로젝트 열기: isswp101/elasticsearch-eloquent

보호된 프로퍼티들

프로퍼티 타입 설명
$linkedFilters array This array contains linked instances of current filter.
$logicalOperator string But you can override it and merge them using OR (should).
$mergeType string But you can override it and merge them using OR (should).
$mode Filter mode.
$values mixed Filter values.

공개 메소드들

메소드 설명
__construct ( mixed $values = null ) Constructor.
getLinkedFilters ( ) : Filter[] Returns linked instances of current filter.
getLogicalOperator ( ) : string Returns linked filters logical operator.
getMergeType ( ) : string Returns filter merge type.
getMode ( ) : string Returns filter mode.
getValues ( ) : mixed Retuns filter values as array.
hasLinkedFilters ( ) : boolean Returns true if filter has linked filters.
isExclude ( ) : boolean Returns true if mode is exclude.
isInclude ( ) : boolean Returns true if mode is include.
isMergeTypeValid ( ) : boolean Returns true if merge type is valid.
isOff ( ) : boolean Returns true if mode is off.
makeQuery ( ) : array Returns wrapped elasticsearch filter query.
mergeQuery ( array $query ) : array Merges elastcisearch query with current filter query.
query ( mixed $values ) : array Returns the actual elasticsearch query for one filter.
setLogicalOperator ( string $logicalOperator ) Updates linked filters logical operator.
setMergeType ( string $mergeType ) Sets filter merge type.
setOptions ( string $mode = null, string $logicalOperator = null, array $linkedFilters = [] ) Set filter options.

보호된 메소드들

메소드 설명
mergeBoolQuery ( array $query1, array $query2, string $type ) : array Merges BOOL elasticsearch queries.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( mixed $values = null )
$values mixed Filter values.

getLinkedFilters() 공개 메소드

Returns linked instances of current filter.
public getLinkedFilters ( ) : Filter[]
리턴 Filter[]

getLogicalOperator() 공개 메소드

Returns linked filters logical operator.
public getLogicalOperator ( ) : string
리턴 string - "AND" || "OR"

getMergeType() 공개 메소드

Returns filter merge type.
public getMergeType ( ) : string
리턴 string - "AND" || "OR"

getMode() 공개 메소드

Returns filter mode.
public getMode ( ) : string
리턴 string Can be as include, exclude or off.

getValues() 공개 메소드

Retuns filter values as array.
public getValues ( ) : mixed
리턴 mixed

hasLinkedFilters() 공개 메소드

Returns true if filter has linked filters.
public hasLinkedFilters ( ) : boolean
리턴 boolean

isExclude() 공개 메소드

Returns true if mode is exclude.
public isExclude ( ) : boolean
리턴 boolean

isInclude() 공개 메소드

Returns true if mode is include.
public isInclude ( ) : boolean
리턴 boolean

isMergeTypeValid() 공개 메소드

Returns true if merge type is valid.
public isMergeTypeValid ( ) : boolean
리턴 boolean

isOff() 공개 메소드

Returns true if mode is off.
public isOff ( ) : boolean
리턴 boolean

makeQuery() 공개 메소드

{ "bool": { "should": [], "must_not": [] } }
public makeQuery ( ) : array
리턴 array

mergeBoolQuery() 보호된 메소드

Merges BOOL elasticsearch queries.
protected mergeBoolQuery ( array $query1, array $query2, string $type ) : array
$query1 array
$query2 array
$type string must, must_not, should
리턴 array

mergeQuery() 공개 메소드

Merges elastcisearch query with current filter query.
public mergeQuery ( array $query ) : array
$query array Elastcisearch query.
리턴 array Merged elasticsearch query.

query() 추상적인 공개 메소드

{ "term": { "price": "0" } }
abstract public query ( mixed $values ) : array
$values mixed
리턴 array

setLogicalOperator() 공개 메소드

Updates linked filters logical operator.
public setLogicalOperator ( string $logicalOperator )
$logicalOperator string - "AND" || "OR"

setMergeType() 공개 메소드

Sets filter merge type.
public setMergeType ( string $mergeType )
$mergeType string - "AND" || "OR"

setOptions() 공개 메소드

Set filter options.
public setOptions ( string $mode = null, string $logicalOperator = null, array $linkedFilters = [] )
$mode string
$logicalOperator string
$linkedFilters array

프로퍼티 상세

$linkedFilters 보호되어 있는 프로퍼티

This array contains linked instances of current filter.
protected array $linkedFilters
리턴 array

$logicalOperator 보호되어 있는 프로퍼티

But you can override it and merge them using OR (should).
protected string $logicalOperator
리턴 string

$mergeType 보호되어 있는 프로퍼티

But you can override it and merge them using OR (should).
protected string $mergeType
리턴 string

$mode 보호되어 있는 프로퍼티

Filter mode.
protected $mode

$values 보호되어 있는 프로퍼티

Filter values.
protected mixed $values
리턴 mixed