I have User
HABTM through Solicitation
that is SocilitationUser
model.
When I do debug($this->User->find('all'));
i get this array
array(
(int) 0 => array(
'User' => array(
'password' => '*****',
'id' => '1',
'username' => 'advogado',
'email' => 'igor.cesar@sotreq.com.br',
'nivel' => 'advogado',
'nome' => 'Bruno',
'superior' => '0',
'sector_id' => '2',
'aprovador' => '1'
),
'SolicitationUser' => array(
(int) 0 => array(
'id' => '9',
'solicitation_id' => '72',
'user_id' => '1',
'funcao' => ''Advogado''
),
(int) 1 => array(
'id' => '11',
'solicitation_id' => '73',
'user_id' => '1',
'funcao' => ''Advogado''
),
......
How can i get All Solicitations
where active = 1
and user.id = 1
??