CakePHP warunek OR dla tego samego pola
Kiedy piszemy warunki w funkcji find w CakePHP to są one automatycznie łączone operatorem AND. Jesli chcemy użyć operatora OR musimy postępować jak poniżej.
$articles = $this->Article('all', array(
'conditions' => array(
'OR' => array(
'Article.status' => 1,
'Article.type' => 2
)
)
)
);
$articles = $this->Article('all', array(
'conditions' => array(
'OR' => array(
array('Article.status' => 1),
array('Article.status' => 2)
)
)
)
);
