mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-06-08 16:22:05 -04:00
24 lines
501 B
PHP
24 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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|