I suppose my problem is simple but i can't get it fixed...
Here is my query:
$this->invites = Doctrine_Query::create()
->from('Utilisateur u')
->LeftJoin('u.Invites i ON i.utilisateur_id = u.id')
->where('u.Invites.invitation_id=', $this->invitation->getId())
->execute();
and here is my schema:
Invites:
columns:
invitation_id: {type: integer, notnull: true }
utilisateur_id: {type: integer, notnull: true }
relations:
Utilisateur: {onDelete: CASCADE, local: utilisateur_id, foreign: id}
Invitation: {onDelete: CASCADE, local: invitation_id, foreign: id, class: Invitation, refClass: Invites}
Utilisateur:
actAs: { Timestampable: ~ }
columns:
email: {type: string(255), notnull: true }
password: {type: string(255), notnull: true }
facebook: {type: integer(11), notnull: true }
smartphone: {type: string(128), notnull: true }
prenom: {type: string(255), notnull: true }
nom: {type: string(255), notnull: true }
daten: {type: timestamp, notnull: true }
sexe: {type: boolean, notnull: true, default: 0}
date: {type: timestamp, notnull: true }
It seems that my "where" clause in not taking into account. If the invitation_id is 3 i still have an "invite" showing up with invitation_id = 1
Can you help me ?
Thank you
EDIT SOlved ! i just needed to add a ? after the equal sign in my where clause :
->where('u.Invites.invitation_id=?', $this->invitation->getId())