[DDC-1637] Linq-like Filter API for collections Created: 06/Feb/12  Updated: 09/Jul/12  Resolved: 09/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 6
Labels: None


We want an API that allows users to filter collections to subsets on the SQL level during the runtime (not using DQL).


class Post
   private $comments;
   public function getRecentComments()
       return $this->comments->select(Expression::lessThan("commentDate", new \DateTime("-7 days")));

The language of this Expressions for selecting entities out of a collection has to be so simple that it works on both arrays and any persistence backed data-source.

The Collection#select() method would return a new collection that is not equal the invoked collection.

Comment by Benjamin Eberlei [ 08/Feb/12 ]

First API example: https://gist.github.com/1766769

Comment by Benjamin Eberlei [ 16/Mar/12 ]

There is a PR now https://github.com/doctrine/common/pull/117

Comment by Benjamin Eberlei [ 09/Jul/12 ]


Generated at Tue Dec 01 11:34:34 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.