DDC-1002: bug in generate entities with many2many relationships from xml/yml shcemes #1249

Closed
opened 2026-01-22 13:07:09 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jan 25, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user stfalcon:

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();
    }```
Originally created by @doctrinebot on GitHub (Jan 25, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user stfalcon: 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(); }``` ``````
admin added the Bug label 2026-01-22 13:07:09 +01:00
admin closed this issue 2026-01-22 13:07:11 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 2, 2011):

Comment created by @beberlei:

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

@doctrinebot commented on GitHub (Feb 2, 2011): Comment created by @beberlei: Fixed the msising constructor. However mind that in my Whitewashing project i wrote the entities manually, not generated them!
Author
Owner

@doctrinebot commented on GitHub (Feb 2, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 2, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1249