Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1927

Pagination of a SELECT of specific fields results in a RuntimeException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Can't Fix
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:

      Description

      When paginating a DQL string which selects specific fields it results in the following error: PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Not all identifier properties can be found in the ResultSetMapping: id'

      NOT working: 'SELECT c.id, c.number FROM Application\Entity\Course c'
      WORKING: 'SELECT c FROM Application\Entity\Course c'
      WORKING: 'SELECT c, c.id, c.number FROM Application\Entity\Course c'

      Setting hydration mode to scalar results makes no difference.

      Gist to example code and stack trace: https://gist.github.com/d5cd6d0b0ac28e722dd7

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Zacharias Luiten
          • Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: