1
I’m trying to make a conditions
in a find
. I have 2 tables: tipopessoas
and pessoas
, on the table pessoas
I have a foreign key for table tipopessoas
. I want my find to bring the result only to two types of people, RESPONSAVEL
and PROFESSOR
, for this I’m trying to use a find with conditions
using OR
, but only one result returns.
How to make it return the 2 types of people 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)));
perfect, thank you very much !
– FernandoPaiva