Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2792

[GH-846] joinColumn is not required in manyToMany

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of terraqout:

      Url: https://github.com/doctrine/doctrine2/pull/846

      Message:

      in annotation you can don't write columns names:

      /**

      • @ManyToMany(targetEntity="Group", inversedBy="users")
      • @JoinTable(name="users_groups")
        */

      but in yaml you should:

      manyToMany:
      groups:
      targetEntity: Group
      inversedBy: users
      joinTable:
      name: users_groups
      joinColumns:
      user_id:
      referencedColumnName: id
      inverseJoinColumns:
      group_id:
      referencedColumnName: id

      this patch fixes this unexpected behavior

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-846] was closed:
        https://github.com/doctrine/doctrine2/pull/846

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-846] was closed: https://github.com/doctrine/doctrine2/pull/846

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: