Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-474

Confusing examples for @ManyToMany in Annotations Reference

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-BETA1
    • Component/s: Documentation
    • Security Level: All
    • Labels:
      None

      Description

      See: http://www.doctrine-project.org/documentation/manual/2_0/en/annotations-reference#reference:@manytomany

      /**
       * Owning Side
       *
       * @ManyToMany(targetEntity="Group")
       * @JoinTable(name="user_groups",
       *      joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
       *      inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")}
       *      )
       */
      private $phonenumbers;
      
      /**
       * Inverse Side
       *
       * @ManyToMany(targetEntity="Feature", mappedBy="product")
       */
      private $features;
      

      Phonenumbers has an M:N relationship with Group through user_groups table, huh? The inverse of this is Products to Feature?

        Activity

        Hide
        Benjamin Eberlei added a comment - - edited

        I must have been on crack while copy-pasting this together

        Show
        Benjamin Eberlei added a comment - - edited I must have been on crack while copy-pasting this together
        Hide
        Benjamin Eberlei added a comment -

        Fixed, manual will auto-update in the next 24 hours

        Show
        Benjamin Eberlei added a comment - Fixed, manual will auto-update in the next 24 hours

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            David Abdemoulaie
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: