0

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

1 Answer 1

1

use IN

$warehouseItemsData = $this->WarehouseEmployers->WarehouseItems->find()
    ->where(['id IN', $array_to_delete])
    ->all();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.