Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-2185

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



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


      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.



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


            • Created: