single or cakephp

Solutions on MaxInterview for single or cakephp by the best coders in the world

showing results for - "single or cakephp"
Woody
14 Jan 2018
1// ------------------------------------
2// ------------ one OR --------------
3// ------------------------------------
4$conditions = array(
5    'OR' => array(
6        array( 'MemberRole.school_id' 	=> array()),
7        array( 'MemberRole.role_id' 	=> $role),
8    );
9);
10
11// ------------------------------------
12// ------------ multiple OR --------------
13// ------------------------------------
14 'OR' => array(
15   array(
16     'MemberRole.school_id' 	=> array(),
17     'MemberRole.role_id' 	=> $role,
18   ),
19   array(
20     'MemberRole.school_id' 	=> array(),
21     'MemberRole.role_id' 	=>  Environment::read('role.register'),
22   ),
23   array(
24     'MemberRole.school_id' 	=> $school_id,
25     'MemberRole.role_id' 	=> Environment::read('role.register'),
26   ),
27   array(
28     'MemberRole.school_id' 	=> $school_id,
29     'MemberRole.role_id' 	=> $role
30   )
31 )