How to create a `IN` clause in CakePHP query? -


how make in clause in new cakephp? i'm trying:

$restaurants->find()->where(['id' => $r_ids])->all(); 

where $r_ids array of ids need in query, doesn't work expected.

with cakephp 3.x it's necessary either indicate data type, array of values need have [] appended type:

$query = $articles     ->find()     ->where(['id' => $ids], ['id' => 'integer[]']); 

or explicitly make use of in keyword:

$query = $articles     ->find()     ->where(['id in' => $ids]); 

see also


Comments

Popular posts from this blog

c - CUDA code not processing if block properly -

oracle11g - get root domain from url Oracle sql regex_substr -

xcode - Swift Playground - Files are not readable -