getting value from string array in cake php

妖精的绣舞 提交于 2020-01-07 03:56:09

问题


If I have this output of an array :

$array_to_delete =
[ 
    (int) 3 => (int) 4,
    (int) 4 => (int) 5 
]

And i want to get 4 and 5 and so on at where condition , Like that :

 $warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
    ->where(['id', $array_to_delete])
    ->all();

How can i do that ? in cake php


回答1:


use IN

$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
    ->where(['id IN', $array_to_delete])
    ->all();


来源:https://stackoverflow.com/questions/45481414/getting-value-from-string-array-in-cake-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!