Provides an ArrayList subclass that supports SearchFilter filtering syntax.
Install via composer:
composer require signify-nz/silverstripe-searchfilter-arraylist
If you want to, you can replace (most) instances of
ArrayList with this implementation via yaml config:
SilverStripe\Core\Injector\Injector: SilverStripe\ORM\ArrayList: class: Signify\SearchFilterArrayList\SearchFilterableArrayList
Beware however that some code - even potentially within Silverstripe itself - may use the
new keyword instead of relying on the
Injector when instantiating new
ArrayLists. In those cases the original
ArrayList class will be used.
excludeAny on a
SearchFilterableArrayList, you can use
SearchFilter syntax - the same as if you were calling those methods on a
All of the
SearchFilters and modifiers documented in Silverstripe's SearchFilter documentation should be supported - if you find that isn't the case, please raise an issue or, better yet, a pull request.
If you have implemented your own
SearchFilter, you can add support for it via an
Extension class - see the extension documentation.