Commit 61de260c authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Convert to iterator

parent 625578d5
...@@ -151,13 +151,20 @@ class QueuedNotification extends CommonDBTM { ...@@ -151,13 +151,20 @@ class QueuedNotification extends CommonDBTM {
&& isset($input['items_id']) && ($input['items_id'] >= 0) && isset($input['items_id']) && ($input['items_id'] >= 0)
&& isset($input['notificationtemplates_id']) && !empty($input['notificationtemplates_id']) && isset($input['notificationtemplates_id']) && !empty($input['notificationtemplates_id'])
&& isset($input['recipient'])) { && isset($input['recipient'])) {
$query = "`is_deleted` = 0 $criteria = [
AND `itemtype` = '".$input['itemtype']."' 'FROM' => $this->getTable(),
AND `items_id` = '".$input['items_id']."' 'WHERE' => [
AND `entities_id` = '".$input['entities_id']."' 'is_deleted' => 0,
AND `notificationtemplates_id` = '".$input['notificationtemplates_id']."' 'itemtype' => $input['itemtype'],
AND `recipient` = '".$input['recipient']."'"; 'items_id' => $input['items_id'],
foreach ($DB->request($this->getTable(), $query) as $data) { 'entities_id' => $input['entities_id'],
'notificationtemplates_id' => $input['notificationtemplates_id'],
'recipient' => $input['recipient']
]
];
$iterator = $DB->request($criteria);
while ($data = $iterator->next()) {
$this->delete(['id' => $data['id']], 1); $this->delete(['id' => $data['id']], 1);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment