Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2863

multiple oneToMany entity relations not working, unless specified under one sigle oneToMany entry

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      this does not work:

      oneToOne:
        user:
          targetEntity: Project\Entity\User
          mappedBy: settings
      oneToOne:
        language:
          targetEntity: Project\Entity\Language
          joinColumn:
            name: language_id
            referencedColumnName: id
      

      and this works:

       
      oneToOne:
        user:
          targetEntity: Project\Entity\User
          mappedBy: settings
        language:
          targetEntity: Project\Entity\Language
          joinColumn:
            name: language_id
            referencedColumnName: id
      

      while the latter is nicer, I don't see why the first one should not work.
      Also, this situation should have been prevented in the documentation.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This is nothing we can prevent or document better. This is just the YAML format and it works like PHP arrays, duplicate key specification removes the previously set data.

        Show
        Benjamin Eberlei added a comment - This is nothing we can prevent or document better. This is just the YAML format and it works like PHP arrays, duplicate key specification removes the previously set data.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Nopcea Francisc
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: