[eluser]Andy78[/eluser]
I want to get all users that have a user_type_id of 1 or 2 and their user_status does not equal 'deleted'.
Currently I have:
Code:
$admin_users = new User();
$admin_users->where('user_status !=', 'deleted');
$admin_users->where('user_type_id', 1);
$admin_users->or_where('user_type_id', 2);
$admin_users->include_related('user_type', array('user_type'), TRUE, TRUE);
This is returning all users where user_status != 'deleted' AND where user_type_id = 1 OR where user_type_id = 2.
Which clearly is not correct because any user with an user_type_id of 2 is returned.
How do I perform this query correctly in datamapper?