[FLOW3-general] collection and mapping problem
Dawid Pacholczyk
dpacholczyk at gmail.com
Sun Aug 28 17:44:52 CEST 2011
Hello List,
I have problem with mapping a field.
I`m creating something like this.
I have User na Address
User can have manny addresses but 1 address can be attached to 1 user
So I`ve Address which has
/**
* @var \MyPackage\Model\Domain\User
* @ManyToOne(targetEntity="MyPackage\Domain\Model\User")
*/
protected $user;
It works like I want to
In User model I`ve created this:
/**
* @var SplObjectStorage<\MyPackage\Model\Domain\Address>
*/
protected $addresses;
I didn`t have problem in the first version of alpha 15. I could validate
it and make an update. yesterday I`ve pulled latest source and doctrine
told me that this field has no type.
"The attribute 'type' is required for the column description of property
MyPackage\Domain\Model\User::$addresses."
I want to have a collections of addresses in my user table.
Tbh when I`m writing this I`ve started to think about association.
Shouldn`t it be some kind of association to addresses ? Like many to
many ? But this is second question.
First is. Why can`t I create field with this kind of type ?
Best regards,
Dawid Pacholczyk
More information about the FLOW3-general
mailing list