I am trying to delete multiple records based on a primary key. The only way I was able to achieve this was through PHQL
$aIDToDel = preg_filter('/chkcntID_*/', '$1', array_keys( $_POST ));
$aIDToDel = array_map('intval', $aIDToDel);
$phql = "DELETE FROM Country WHERE cntID IN (".$sIDToDel.")";
$this->modelsManager->executeQuery($phql);
How can I get result after executing this query (i.e. 20 records affected)? Is there any other way of doing this? I found a nice way of doing this but it is for MongoDB (I am using MySQL)
$countries = Country::find([['cntID' => ['$in' => $aIDToDel]]]);
foreach ($countries as $country) {
if ($country->delete() == false) { ...