PHP Class Isswp101\Persimmon\QueryBuilder\Filters\Filter

Afficher le fichier Open project: isswp101/elasticsearch-eloquent

Protected Properties

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
mergeBoolQuery ( array $query1, array $query2, string $type ) : array Merges BOOL elasticsearch queries.

Method Details

__construct() public méthode

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

getLinkedFilters() public méthode

Returns linked instances of current filter.
public getLinkedFilters ( ) : Filter[]
Résultat Filter[]

getLogicalOperator() public méthode

Returns linked filters logical operator.
public getLogicalOperator ( ) : string
Résultat string - "AND" || "OR"

getMergeType() public méthode

Returns filter merge type.
public getMergeType ( ) : string
Résultat string - "AND" || "OR"

getMode() public méthode

Returns filter mode.
public getMode ( ) : string
Résultat string Can be as include, exclude or off.

getValues() public méthode

Retuns filter values as array.
public getValues ( ) : mixed
Résultat mixed

hasLinkedFilters() public méthode

Returns true if filter has linked filters.
public hasLinkedFilters ( ) : boolean
Résultat boolean

isExclude() public méthode

Returns true if mode is exclude.
public isExclude ( ) : boolean
Résultat boolean

isInclude() public méthode

Returns true if mode is include.
public isInclude ( ) : boolean
Résultat boolean

isMergeTypeValid() public méthode

Returns true if merge type is valid.
public isMergeTypeValid ( ) : boolean
Résultat boolean

isOff() public méthode

Returns true if mode is off.
public isOff ( ) : boolean
Résultat boolean

makeQuery() public méthode

{ "bool": { "should": [], "must_not": [] } }
public makeQuery ( ) : array
Résultat array

mergeBoolQuery() protected méthode

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

mergeQuery() public méthode

Merges elastcisearch query with current filter query.
public mergeQuery ( array $query ) : array
$query array Elastcisearch query.
Résultat array Merged elasticsearch query.

query() abstract public méthode

{ "term": { "price": "0" } }
abstract public query ( mixed $values ) : array
$values mixed
Résultat array

setLogicalOperator() public méthode

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

setMergeType() public méthode

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

setOptions() public méthode

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

Property Details

$linkedFilters protected_oe property

This array contains linked instances of current filter.
protected array $linkedFilters
Résultat array

$logicalOperator protected_oe property

But you can override it and merge them using OR (should).
protected string $logicalOperator
Résultat string

$mergeType protected_oe property

But you can override it and merge them using OR (should).
protected string $mergeType
Résultat string

$mode protected_oe property

Filter mode.
protected $mode

$values protected_oe property

Filter values.
protected mixed $values
Résultat mixed