Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2185

Better explain DQL "WITH" and implications for the collection filtering API

    Details

      Description

      Available documentation is a bit thin regarding the "WITH" clause on JOIN expressions. Only a single example is provided in

      http://docs.doctrine-project.org/en/2.1/reference/dql-doctrine-query-language.html#dql-select-examples

      WITH seems to allow to only "partially" load a collection, so the collection in memory does not fully represent the associations available in the database.

      The resulting collection is marked as "initialized" and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized.

      When using the collection filtering API, the "initialized" flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect.

      I assume this is by design (no idea how the collection could be "partially" loaded and behave correctly under all conditions), so filing it as a documentation issue.

        Activity

        Matthias Pigulla created issue -

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Matthias Pigulla
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: