1 | <?php |
||
28 | class WrapArray extends Zero { |
||
29 | protected $data; |
||
30 | protected $pos; |
||
31 | |||
32 | function __construct($array = array()) { |
||
33 | $this->data = $array; |
||
34 | $this->pos = 0; |
||
35 | } |
||
36 | |||
37 | function hamleGet($key) { |
||
38 | if (!isset($this->data[$this->pos][$key])) |
||
39 | return "Missing Key [$key]"; |
||
40 | return $this->data[$this->pos][$key]; |
||
41 | } |
||
42 | |||
43 | function valid() { |
||
44 | return isset($this->data[$this->pos]); |
||
45 | } |
||
46 | |||
47 | function key() { |
||
48 | return $this->pos; |
||
49 | } |
||
50 | |||
51 | function current() { |
||
52 | return $this; |
||
53 | } |
||
54 | |||
55 | function rewind() { |
||
56 | $this->pos = 0; |
||
57 | } |
||
58 | |||
59 | function next() { |
||
60 | ++$this->pos; |
||
61 | } |
||
62 | |||
63 | } |