Your relation names need to be unique:

peer_request:
  columns:
    person_id:         { type: integer, notnull: true }
    peer_id:           { type: integer, notnull: true }
  relations:
    person:            { local: person_id, foreign: id }
    *peer*:              { local: peer_id, foreign: id }

On Sat, May 7, 2011 at 10:18 AM, dmitrypol <dmitry...@gmail.com> wrote:

> I am building an app using Symfony 1.4.11 and Doctrine 1.2.4.  I have 2
> tables - person and peer_request.  Person has the usual name, address,
> email, etc.
>
> peer_request:
>   columns:
>     person_id:         { type: integer, notnull: true }
>     peer_id:           { type: integer, notnull: true }
>   relations:
>     person:            { local: person_id, foreign: id }
>     person:            { local: peer_id, foreign: id }
>
> I need to display the requests sent and received.  I created methods to
> join peer_request to person and query the data.  The problem is that
> leftJoin is always done on peer_id when I need it to be on person_id in one
> case.
>
> ->select('pr.*, p.email')
> ->from('peer_request pr')
> ->leftJoin('pr.person p')
>
> From my log:    LEFT JOIN person p2 ON p.peer_id = p2.id WHERE ...
>
> I would appreciate any advice.  Thank you very much.
>
> Dmitry
>
>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to