OR conditions in find [solved]


How do you build OR conditions in cakephp 3 find method ?
I could not find any example in the cook book.

How to use orwhere condition in $this->paginate in cakephp 3

Here it is:



Thank you for your answer


You are welcome. :slight_smile:

If you have found your solution with my answer then make sure you change the Title of your topic to

OR conditions in find [Solved]

It will save time of those who are here to answer to people’s question.


I want to add OR condition in this paginate array.

$conditions = array();
$conditions[‘Years.id’] = 2;
$this->paginate = [
‘contain’ => [‘Courses’, ‘Streams’, ‘Years’, ‘Subjects’],
‘conditions’ => [$condition]


What controller or table are you working with ?

I can see an error:
‘conditions’ => [$condition] should be:
'conditions => $conditions