Filters

From Sunhill Framework Documentation

What are Filters?

Filters are a series of method that are performed on a sepcialized container object when certain conditions are met.

The filter container

Filters are always performed on an filter container. This is a specialized class that acts like an array and stores several conditions. These conditions are checked by the filter. If all match the execute() method is called.

hasCondition(string $name): bool

Returns true when the given condition is defined in this container.

conditionWriteable(string $name): bool

Returns true when the given condition may be overwritten by a filter.

getCondition(string $name)

Returns the given condition.

setCondition(string $name, $value = true)

Sets the given condition.

The filter class

setContainer(FilterContainer $container): static

addCondition(string $name, $condition)

addAlternativeCondition(array $condition)

matches(?FilterContainer $container = null): bool

execute(): string

For more information see here.

The filters facade

For more Information see here.