DDC-1637: Linq-like Filter API for collections #2278

Closed
doctrinebot opened this Issue Feb 6, 2012 · 4 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

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

Example:

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.

@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

Comment created by @beberlei:

There is a PR now doctrine/common#117

@doctrinebot

Comment created by @beberlei:

Implemented

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment