function Delete($arID) { $ID = array(); if (!is_array($arID)) { $arID = array("EVENT_NAME" => $arID); } foreach ($arID as $k => $v) { if (!in_array(strToUpper($k), array("ID", "LID", "EVENT_NAME", "NAME", "SORT"))) { continue; } $ID[$k] = $v; } if (!empty($ID)) { $res = null; $affectedRowsCount = 0; $listDb = Mail\Internal\EventTypeTable::getList(array('select' => array('ID'), 'filter' => $ID)); while ($arListId = $listDb->fetch()) { $result = Mail\Internal\EventTypeTable::delete($arListId['ID']); if ($result->isSuccess()) { $affectedRowsCount++; } else { $res = false; break; } } if ($res === null) { $res = new CDBResultEventMultiResult(); $res->affectedRowsCount = $affectedRowsCount; } return $res; } return false; }