I've been studying the doctrine/collection library and one good idea I want to implement (possibly) is a dedicated criteria class that would allow me to remove all those "WHERE_" class constants from the collection class and instead of:
$coll = collect(get_data_from_somewhere());
$keyStartsWithFoo = new Criterion\Like("foo%", 'key'); // optional key
$keyRegExp = new Criterion\RegExpLike("/[a-z]+\.[0-9]+/i", 'key'); // optional key
$where = new Criterion\LogicalOr([$keyStartsWithFoo, $keyRegExp]);
foreach ($coll->select($where) as $key => $val) {
// the above may be a little more complex than I actually need... we'll see...
}
I've been studying the doctrine/collection library and one good idea I want to implement (possibly) is a dedicated criteria class that would allow me to remove all those "WHERE_" class constants from the collection class and instead of: