is there a way to select all database results with a many many relationship that do not have a relation?
I have a Role model and Permissions model, but how would I get all permissions that are not in the jointable?
Something like…
Permissions::model()->with(
array(
'roles'=>array( 'condition' => Yii::app()->controller->module->tbl_role_has_permissions.'.role_id != '.$role_id),
))->findAll();
will not work cause it does not do the parameter on the join table
The normal sql would probably look something like…
select * from permissions
left join role_has_permissions
on permissions.id=role_has_permissions.permissions_id
where role_has_permissions.permissions_id is null;