[eluser]Iverson[/eluser]
[quote author="tdktank59" date="1236738273"]well 1 option is to do something like this
Code:
$u = new User();
$u->where('id',$id);
$u->projects()->get();
foreach ($u->projects->all as $projects)
{
$project_ids = array($projects->id);
}
$p = new Project();
$p->where_not_in('id',$project_ids)->get();
see where im going with this?[/quote]
Thanks! I just needed to a jumpstart
Only thing I needed to change from your code was to make $project_ids an array instead of the object's id. This might be a good addition to Datamapper as I can see others using this just as much as relationships.
Code:
$u = new User();
$u->where('id',$id);
$u->projects()->get();
foreach ($u->projects->all as $projects)
{
$project_ids[] = $projects->id;
}
$p = new Project();
$p->where_not_in('id',$project_ids)->get();