Cakephp 3 query OR Condition -


guys how can apply or condition in following statement ?

$this->ibcommisions->find()->matching(     'users.accounts',function ($q) {         return $q->where(['ibcommisions.ib_id' => $this->userid, 'users.country_id' => $this->request->data['country']]); } 

to become

(['ibcommisions.ib_id' => $this->userid or 'users.country_id' => $this->request->data['country']]) 

return $q->where(['or' => [     'ibcommisions.ib_id' => $this->userid,     'users.country_id' => $this->request->data['country'] ]]); 

or alternatively

return $q->where(['ibcommisions.ib_id' => $this->userid])     ->orwhere(['users.country_id' => $this->request->data['country']]); 

http://book.cakephp.org/3.0/en/orm/query-builder.html#advanced-conditions


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -