I'm using Phalcon 3. I create a web service who take in parameter a list of ids then I check if theses ids exist (with IN condition) in my database then I update them.
They are all updated except one who is the first of my ids list.
There is a problem with my bind condition ? I can confirm than it is present in the $ids array. I have the problem too if I have just 1 id inside my list, this id will be ignored.
public function myAction() {
$this->view->disable();
$tools = new Tools();
$api_key = $this->request->getQuery('apiKey');
$ids = explode(",", $this->request->getPut('ids'));
...
$objects = Objects::find(array(
"conditions" => "id IN ({ids:array})",
"bind" => array("ids" => $ids)
));
if (count($objects) > 0) {
foreach ($objects as $obj) {
...
}
}
return $tools->JSONBuilder(array("success" => "message"), 200);
}