-
Notifications
You must be signed in to change notification settings - Fork 0
clue-legacy/Filter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
== Description == Construct SQL WHERE clauses, filter arrays/iterators, etc. Author: Christian Lück <[email protected]> Homepage: https://github.com/clue/Filter License: MIT-style license == Example == <?php $filter = Filter::all(Filter::keyEq('name','Pete'),Filter::keyGt('id',10)); $filter->toSql(); // `name`='Pete' AND 'id'>10 foreach($filter->toIterator($users) as $user){ // iterate over all users matching the filter } $filtered = Filter::negate($filter)->apply($users); // only keep users that did NOT match filter $filter->matches(array('name'=>'Pete','id'=>100)); // true ?> == Requirements / Dependencies == * PHP 5.3+ == Known issues == * Converting a filter to a SQL query string (WHERE clause) requires access to a proprietary/unreleased database class. Altough a possible option, I personally feel releasing yet another database abstraction layer class is totally redundant and should be avoided. Any ideas on how to avoid this issue welcome!
About
[deprecated] Create SQL 'WHERE' clauses and/or manually filter arrays
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published