class EmailFilterGambit extends AbstractRegexGambit implements FilterInterface

Traits

Methods

getGambitPattern()

<p>The regex pattern to match the bit against.</p>

bool
apply(SearchState $search, string $bit)

<p>Apply conditions to the searcher for a bit of the search string.</p>

array|null
match(string $bit)

<p>Match the bit against this gambit.</p>

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

<p>Apply conditions to the search, given that the gambit was matched.</p>

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()

<p>This filter will only be run when a query contains a filter param with this key.</p>

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

<p>Filters a query.</p>

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

No description

Details

getGambitPattern()

<p>The regex pattern to match the bit against.</p>

bool apply(SearchState $search, string $bit)

<p>Apply conditions to the searcher for a bit of the search string.</p>

Parameters

SearchState $search
string $bit <p>The piece of the search string.</p>

Return Value

bool <p>Whether or not the gambit was active for this bit.</p>

protected array|null match(string $bit)

<p>Match the bit against this gambit.</p>

Parameters

string $bit

Return Value

array|null

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

<p>Apply conditions to the search, given that the gambit was matched.</p>

Parameters

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

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()

<p>This filter will only be run when a query contains a filter param with this key.</p>

Return Value

string

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

<p>Filters a query.</p>

Parameters

FilterState $filterState
string $filterValue
bool $negate

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

Parameters

Builder $query
$rawEmail
bool $negate