I think i've figured something out by using a custom dbal type. I have to 
define types for all of my entity id's though, ex: UserId, TaskId, 
ProjectId, etc. Ross Tuck seems to think 
<http://rosstuck.com/persisting-value-objects-in-doctrine/#comment-1508500833> 
you could generate an object based on the columns metadata but i can't 
figure out where he's suggesting to use the *voClass*. 



On Tuesday, June 9, 2015 at 1:31:45 PM UTC-5, David Adams wrote:
>
> I have no trouble using embeddables except for when using one for an id 
> object. Here's my mapping file. 
>
> Acme\Project\Model\User\Entity\User:
>     type: entity
>     table: app_user
>     id:
>         id:
>             type: guid
>             generator:
>                 strategy: NONE
>     embedded:
>         email:
>             class: Acme\Project\Model\User\ValueObject\Email
>             columnPrefix: false
>         username:
>             class: Acme\Project\Model\User\ValueObject\Username
>             columnPrefix: false
>         password:
>             class: Acme\Project\Model\User\ValueObject\EncodedPassword
>             columnPrefix: false
>         confirmationToken:
>             class: Acme\Project\Model\User\ValueObject\ConfirmationToken
>             columnPrefix: false
>     fields:
>         createdAt:
>             type: datetimetz
>             column: created_at
>
> How do I configure the id property to be an instance of *UserId*? If I 
> define it under *embedded:*, doctrine complains about it being defined 
> twice. If I then remove the *id: *section, doctrine complains that 
> there's not an id field defined for the entity. Any ideas?
>

-- 
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