Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1096

"You may have observed that in a mixed result, the object always ends up on index 0 of a result row."

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      The DQL reference at

      http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html

      defines that

      "You may have observed that in a mixed result, the object always ends up on index 0 of a result row."

      I find this too important to state it in such a parenthetic way.

      The reordering is counterintuitive behaviour at its worst, and grossly in violation of the principle of least astonishment. I bet noone would even guess that this could be intended behaviour. I would not consider this a classic bug, as it is documented behaviour, but as a way of deliberately doing it wrong, making mixed results totally counterintuitive to use. From a usability standpoint, this is as bad as it gets.

      I cannot think of any convincing reason why the ORM should decide on its own, and without any notice, to change the explicitly specified ordering from the select list, because it is absolutely confusing and IMO there is no advantage at all in doing so.

      I explicitly told Doctrine 2 to put the entity element on position 3, so why should it end up at position 0 without further notice? If position 0 is a must (which I do not think it should be), then the user should not be able to specify entity elements at any other position than that. As long as other positions are permissible, I would rather have the element stay at the exact position declared, and not be shuffled around.

        Issue Links

          Activity

            People

            • Assignee:
              Guilherme Blanco
              Reporter:
              Daniel Alvarez Arribas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: