multiple or cakephp

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

showing results for - "multiple or cakephp"
Hanna
30 Nov 2019
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 )
Emmalee
15 Apr 2016
1
2// ------------------------------------
3// ------------ MULTI OR --------------
4// ------------------------------------
5
6$conditions = array();
7
8
9$conditions = array(
10  'OR' => array(
11    array(
12      'MemberRole.school_id' 	=> array(),
13      'MemberRole.role_id' 	=> $role,
14    ),
15    array(
16      'MemberRole.school_id' 	=> array(),
17      'MemberRole.role_id' 	=>  Environment::read('role.register'),
18    ),
19    array(
20      'MemberRole.school_id' 	=> $school_id,
21      'MemberRole.role_id' 	=> Environment::read('role.register'),
22    ),
23    array(
24      'MemberRole.school_id' 	=> $school_id,
25      'MemberRole.role_id' 	=> $role
26    ),
27  ),
28);