summaryrefslogtreecommitdiffstats
path: root/application/forms/Command/Object/RemoveAcknowledgementForm.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:45:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:45:00 +0000
commit7c19368db58f16858fde7f1c5fe50c0d640c0482 (patch)
treeb416482e821607bcef8656c462d39ff995d65db0 /application/forms/Command/Object/RemoveAcknowledgementForm.php
parentAdding upstream version 1.1.1. (diff)
downloadicingadb-web-upstream.tar.xz
icingadb-web-upstream.zip
Adding upstream version 1.1.2.upstream/1.1.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/forms/Command/Object/RemoveAcknowledgementForm.php')
-rw-r--r--application/forms/Command/Object/RemoveAcknowledgementForm.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/application/forms/Command/Object/RemoveAcknowledgementForm.php b/application/forms/Command/Object/RemoveAcknowledgementForm.php
index 8697985..d81fe7f 100644
--- a/application/forms/Command/Object/RemoveAcknowledgementForm.php
+++ b/application/forms/Command/Object/RemoveAcknowledgementForm.php
@@ -4,11 +4,14 @@
namespace Icinga\Module\Icingadb\Forms\Command\Object;
+use CallbackFilterIterator;
use Icinga\Module\Icingadb\Command\Object\RemoveAcknowledgementCommand;
use Icinga\Module\Icingadb\Forms\Command\CommandForm;
use Icinga\Module\Icingadb\Model\Host;
use Icinga\Web\Notification;
+use ipl\Orm\Model;
use ipl\Web\Widget\Icon;
+use Iterator;
use Traversable;
use function ipl\Stdlib\iterable_value_first;
@@ -62,10 +65,13 @@ class RemoveAcknowledgementForm extends CommandForm
);
}
- protected function getCommands(Traversable $objects): Traversable
+ protected function getCommands(Iterator $objects): Traversable
{
- $granted = $this->filterGrantedOn('icingadb/command/remove-acknowledgement', $objects);
+ $granted = new CallbackFilterIterator($objects, function (Model $object): bool {
+ return $this->isGrantedOn('icingadb/command/remove-acknowledgement', $object);
+ });
+ $granted->rewind(); // Forwards the pointer to the first element
if ($granted->valid()) {
$command = new RemoveAcknowledgementCommand();
$command->setObjects($granted);