Thx Marco for your answer.

But according to Eric Evans book about DDD, VO can contains reference 
entities.

So it's not possible with Doctrine 2 to have VO Collections in entity ?

Le vendredi 14 mars 2014 18:00:28 UTC+1, Marco Pivetta a écrit :
>
> Hi Florent,
>
> A ValueObject cannot reference entities, it can only contain values.
>
> Cheers,
>
> Marco Pivetta 
>
> http://twitter.com/Ocramius      
>
> http://ocramius.github.com/
>
>
> On 14 March 2014 17:22, Florent Paterno <[email protected] 
> <javascript:>>wrote:
>
>> Hi guys,
>>
>> I'm trying to use Doctrine embedded collection (with Doctrine 2.5.0-DEV) 
>> and have some problem with it.
>>
>> I've 2 classes :
>>
>> 1 classic entity with value objects collection
>>
>> class Entity{
>>     protected $id; // integer
>>     protected $valueObjects; // Doctrine ValueObject ArrayCollection
>> }
>>
>> and a value object class with several properties (object).
>>
>> class ValueObject{
>>     protected $obj1; // Obj1
>>     protected $obj2; // Obj2
>> }
>>
>> Here is my ValueObject definition (yml) :
>>
>> ValueObject:
>>     type: embeddable
>>     fields:
>>         obj2:
>>             type: object
>>     manyToOne:
>>         obj1:
>>             targetEntity: Obj1
>>
>> But nothing happens ... How can i define value object collection ?
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "doctrine-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/doctrine-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to