Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1002

bug in generate entities with many2many relationships from xml/yml shcemes

    Details

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

      Description

      I try use many2many relations in my symfony2 learning project https://github.com/symfony/symfony.git
      But entities thar generates from yml schemes did not meet entities from doctrine2 guide or entities from beberlei Whitewashing project https://github.com/beberlei/Whitewashing/tree/master/Blog

      After that I try generate similar entitries is doctrine2-sandbox. Problem is the same
      I attached yml schemes and result entities.

      Problem:

      • Entities\Address does not have relations with Entities\User
      • In Entities\User property $adresses instance of Entity\Address. But this Doctrine\Common\Collections\ArrayCollection or no?
            /**
             * @var Entity\Address
             */
            private $addresses;
      • In Entities\User not at __constructor() method:
            public function __construct()
            {
                $this->addresses = new ArrayCollection();
            }
      1. Entities.tar.gz
        0.5 kB
        Stepan Tanasiychuk
      2. yml.tar.gz
        0.4 kB
        Stepan Tanasiychuk

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed the msising constructor. However mind that in my Whitewashing project i wrote the entities manually, not generated them!

        Show
        Benjamin Eberlei added a comment - Fixed the msising constructor. However mind that in my Whitewashing project i wrote the entities manually, not generated them!

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Stepan Tanasiychuk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: