mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-11 20:06:14 -04:00
Nodes might be referenced by multiple independent paths, which might lead to the same root problem multiple times.
23 lines
501 B
PHP
23 lines
501 B
PHP
<?php
|
|
|
|
namespace Icinga\Module\Icingadb\Model\UnreachableParent;
|
|
|
|
use Icinga\Module\Icingadb\Redis\VolatileStateResults;
|
|
use Traversable;
|
|
|
|
class ResultSet extends VolatileStateResults
|
|
{
|
|
protected function yieldTraversable(Traversable $traversable)
|
|
{
|
|
$knownIds = [];
|
|
foreach ($traversable as $value) {
|
|
if (isset($knownIds[$value->id])) {
|
|
continue;
|
|
}
|
|
|
|
$knownIds[$value->id] = true;
|
|
|
|
yield $value;
|
|
}
|
|
}
|
|
}
|