X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fseekat;a=blobdiff_plain;f=lib%2FAPI%2FIterator.php;fp=lib%2FAPI%2FIterator.php;h=0000000000000000000000000000000000000000;hp=b2187478e3e1eb8835d53fea62d58e525ff9d879;hb=654d736df2c46ec2520f73e9089d06a44f2b9c50;hpb=2121556150be871684b5046af7cf250b8219128d diff --git a/lib/API/Iterator.php b/lib/API/Iterator.php deleted file mode 100644 index b218747..0000000 --- a/lib/API/Iterator.php +++ /dev/null @@ -1,89 +0,0 @@ -api = $api; - $this->data = (array) $api->export()["data"]; - } - - /** - * Get the current key - * - * @return int|string - */ - function key() { - return $this->key; - } - - /** - * Get the current data entry - * - * @return API - */ - function current() { - return $this->cur; - } - - function next() { - if (list($key, $cur) = each($this->data)) { - $this->key = $key; - if ($this->api->$key->exists("url", $url)) { - $url = new Url($url); - $this->cur = $this->api->withUrl($url)->withData($cur); - } else { - $this->cur = $this->api->$key->withData($cur); - } - } else { - $this->key = null; - $this->cur = null; - } - } - - function valid() { - return isset($this->cur); - } - - function rewind() { - if (is_array($this->data)) { - reset($this->data); - $this->next(); - } - } -}