Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0
-
Component/s: ORM
-
Security Level: All
-
Labels:None
-
Environment:HideLinux stfalcon-laptop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux
Installed packages, channel pear.doctrine-project.org:
======================================================
Package Version State
DoctrineCommon 2.0.0 stable
DoctrineDBAL 2.0.0 stable
DoctrineORM 2.0.0 stableShowLinux stfalcon-laptop 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010 x86_64 GNU/Linux Installed packages, channel pear.doctrine-project.org: ====================================================== Package Version State DoctrineCommon 2.0.0 stable DoctrineDBAL 2.0.0 stable DoctrineORM 2.0.0 stable
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(); }
Fixed the msising constructor. However mind that in my Whitewashing project i wrote the entities manually, not generated them!