diff --git a/library/Icinga/Util/Enumerate.php b/library/Icinga/Util/Enumerate.php new file mode 100644 index 000000000..0861f7f65 --- /dev/null +++ b/library/Icinga/Util/Enumerate.php @@ -0,0 +1,62 @@ +iterator = $iterator; + } + + public function rewind() + { + $this->iterator->rewind(); + $this->key = 0; + } + + public function next() + { + $this->iterator->next(); + ++$this->key; + } + + public function valid() + { + return $this->iterator->valid(); + } + + public function current() + { + return $this->iterator->current(); + } + + public function key() + { + return $this->key; + } +}