Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1637

Linq-like Filter API for collections

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      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.

        Activity

        Benjamin Eberlei created issue -
        Hide
        Benjamin Eberlei added a comment -
        Show
        Benjamin Eberlei added a comment - First API example: https://gist.github.com/1766769
        Hide
        Benjamin Eberlei added a comment -
        Show
        Benjamin Eberlei added a comment - There is a PR now https://github.com/doctrine/common/pull/117
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13422 ] jira-feedback [ 14020 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14020 ] jira-feedback2 [ 15884 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15884 ] jira-feedback3 [ 18140 ]
        Hide
        Benjamin Eberlei added a comment -

        Implemented

        Show
        Benjamin Eberlei added a comment - Implemented
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1637, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: