Try this:

$c = Criteria;
$c -> addJoin(UserPeer::ID, ListUserPeer::USER_ID,
Criteria::LEFT_JOIN);
$c -> add(ListUserPeer::USER_ID, null, Criteria::ISNULL);

that should work.
Also, you don't need an id column in the list_user table, in fact it
interferes with symfony on some levels.
Just set both user_id and list_id to primaryKey: true and drop the id
column.

Hope this helps,
Daniel



On Mar 17, 9:29 am, "[email protected]" <[email protected]> wrote:
> Sorry if this question is a little basic.
>
> I'm trying to create a Criteria to retrieve records from a table that
> aren't in another table as a foreign key.
>
> User:
>   id: ~
>   name: varchar(255)
>
> ListUser:
>   id:  ~
>   user_id: ~
>   list_id:   ~
>
> Trying to retrieve records from User that aren't in ListUser.  Is
> there an easy way to do this with Criteria?
>
> Thanks,
>
> -Brendan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to