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++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -