X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=testcms-final-anon%2Fsystem%2Fclasses%2Fitems.php;fp=testcms-final-anon%2Fsystem%2Fclasses%2Fitems.php;h=b6714acf364937ffe4187f0ec09c6a8f0f2fe5fa;hb=487e0193c6d3093651c15b478e9e56b6a2f550f9;hp=0000000000000000000000000000000000000000;hpb=e48921c08b5a6cae18d285ef9979b625e4558b4b;p=ssproject1617.git diff --git a/testcms-final-anon/system/classes/items.php b/testcms-final-anon/system/classes/items.php new file mode 100644 index 0000000..b6714ac --- /dev/null +++ b/testcms-final-anon/system/classes/items.php @@ -0,0 +1,46 @@ +position = 0; + $this->items = $array; + } + + public function rewind() { + $this->position = 0; + } + + public function current() { + return $this->items[$this->position]; + } + + public function key() { + return $this->position; + } + + public function next() { + ++$this->position; + } + + public function valid() { + return isset($this->items[$this->position]); + } + + public function length() { + return count($this->items); + } + + public function first() { + return isset($this->items[0]) ? $this->items[0] : false; + } + + public function last() { + $index = count($this->items) - 1; + return isset($this->items[$index]) ? $this->items[$index] : false; + } + +}