1 | <?php |
||
35 | class Iter extends Object implements \Iterator |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * Holds the internal array |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $arr = array(); |
||
44 | |||
45 | /** |
||
46 | * Constructor that initializes the internal member |
||
47 | * with the array passed as parameter. |
||
48 | * |
||
49 | * @param array $array Holds the array |
||
50 | */ |
||
51 | 3 | public function __construct($array) |
|
57 | |||
58 | /** |
||
59 | * Resets the internal array pointer to |
||
60 | * the first entry. |
||
61 | * |
||
62 | * And returns the value therefore. |
||
63 | * |
||
64 | * @return mixed Holds the first value of the internal array |
||
65 | */ |
||
66 | 3 | public function rewind() |
|
70 | |||
71 | /** |
||
72 | * Returns the actual entry. |
||
73 | * |
||
74 | * @return mixed The actual entry of the internal array |
||
75 | */ |
||
76 | 3 | public function current() |
|
80 | |||
81 | /** |
||
82 | * Returns the key of the actual entry. |
||
83 | * |
||
84 | * @return mixed The key of actual entry of the internal array |
||
85 | */ |
||
86 | 3 | public function key() |
|
90 | |||
91 | /** |
||
92 | * Returns the next entry. |
||
93 | * |
||
94 | * @return mixed The next entry of the internal array |
||
95 | */ |
||
96 | 3 | public function next() |
|
100 | |||
101 | /** |
||
102 | * Checks if the actual entry of the internal |
||
103 | * array is not false. |
||
104 | * |
||
105 | * @return boolean TRUE if there is a actual entry in the internal array, else FALSE |
||
106 | */ |
||
107 | 3 | public function valid() |
|
111 | |||
112 | /** |
||
113 | * This method sets the internal array pointer |
||
114 | * to the end of the array and returns the |
||
115 | * value therefore. |
||
116 | * |
||
117 | * @return mixed Holds the last value of the internal array |
||
118 | */ |
||
119 | public function last() |
||
123 | } |
||
124 |