Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1382

getIdentifierValues causes an exception on entyties that have only association keys

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      ubuntu

      Description

      On entities that have only association keys as primary keys:

      Calling BasicEntityPersister::exists() cause the invocation of ClassMetadata::getIdentifierValues() method.
      This method returns associated entities as identifier values.
      Then BasicEntityPersister::exists() tries to converts these objects to string, instead of searching their primary keys.

      Some problems:

      • getIdentifierValues have not access to external world (only its class metadata and the current entity).
      • getIdentifierValues is uses in many places of doctrine

      (sorry for my bad English)

        Activity

        Hide
        Guilherme Blanco added a comment -
        Show
        Guilherme Blanco added a comment - Fixed in https://github.com/doctrine/doctrine2/commit/24042863acbabdcd0fa1432135a9836467f3bce7 It should be available in next release.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Asmir Mustafic
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: