Reputation: 71
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
Upvotes: 0
Views: 163
Reputation: 9398
use IN
$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
->where(['id IN', $array_to_delete])
->all();
Upvotes: 1