I'm trying to make a conditions
into a find
. I have 2 tables: tipopessoas
and pessoas
, in table pessoas
I have a foreign key for table tipopessoas
. I want my find to bring the result just for two types of people, RESPONSAVEL
and PROFESSOR
, so I'm trying to use a find with conditions
using OR
, but only one result returns.
How do I get the 2 types of people back and not just 1?
I'm trying like this.
$this->set("pessoas", $this->User->Pessoa->find('list', array(
'fields' => array("Pessoa.id", "Pessoa.nome", "Pessoa.tipopessoas_id",'Tipopessoa.id','Tipopessoa.descricao'),
"conditions"=>array("OR"=>array('Tipopessoa.descricao = '=>'RESPONSAVEL',
'Tipopessoa.descricao = '=>'PROFESSOR')),
'recursive' => 0)));