class EmailFilterGambit extends AbstractRegexGambit implements FilterInterface

Traits

Methods

getGambitPattern()

The regex pattern to match the bit against.

bool
apply(SearchState $search, string $bit)

Apply conditions to the searcher for a bit of the search string.

array|null
match(string $bit)

Match the bit against this gambit.

mixed
conditions(SearchState $search, array $matches, bool $negate)

Apply conditions to the search, given that the gambit was matched.

array
asStringArray($filterValue, bool $multidimensional = false)

No description

string
asString($filterValue)

No description

int
asInt($filterValue)

No description

array
asIntArray($filterValue)

No description

bool
asBool($filterValue)

No description

string
getFilterKey()

This filter will only be run when a query contains a filter param with this key.

filter(FilterState $filterState, string $filterValue, bool $negate)

Filters a query.

constrain(Builder $query, $rawEmail, bool $negate)

No description

Details

getGambitPattern()

The regex pattern to match the bit against.

bool apply(SearchState $search, string $bit)

Apply conditions to the searcher for a bit of the search string.

Parameters

SearchState $search
string $bit The piece of the search string.

Return Value

bool Whether or not the gambit was active for this bit.

protected array|null match(string $bit)

Match the bit against this gambit.

Parameters

string $bit

Return Value

array|null

protected mixed conditions(SearchState $search, array $matches, bool $negate)

Apply conditions to the search, given that the gambit was matched.

Parameters

SearchState $search The search object.
array $matches An array of matches from the search bit.
bool $negate Whether or not the bit was negated, and thus whether or not the conditions should be negated.

Return Value

mixed

protected array asStringArray($filterValue, bool $multidimensional = false)

Parameters

$filterValue
bool $multidimensional

Return Value

array

Exceptions

ValidationException

protected string asString($filterValue)

Parameters

$filterValue

Return Value

string

Exceptions

ValidationException

protected int asInt($filterValue)

Parameters

$filterValue

Return Value

int

Exceptions

ValidationException

protected array asIntArray($filterValue)

Parameters

$filterValue

Return Value

array

Exceptions

ValidationException

protected bool asBool($filterValue)

Parameters

$filterValue

Return Value

bool

Exceptions

ValidationException

string getFilterKey()

This filter will only be run when a query contains a filter param with this key.

Return Value

string

filter(FilterState $filterState, string $filterValue, bool $negate)

Filters a query.

Parameters

FilterState $filterState
string $filterValue
bool $negate

protected constrain(Builder $query, $rawEmail, bool $negate)

Parameters

Builder $query
$rawEmail
bool $negate