12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace Core;
- class AllUser implements \Iterator
- {
-
- protected $index;
-
- protected $ids = array();
-
- protected $user;
- public function __construct()
- {
- $this->user = new \Core\User();
- $this->ids = $this->user->getIds();
- }
-
- public function current()
- {
-
- $id = $this->ids[$this->index]['id'];
- return $this->user->getUserById($id);
- }
-
- public function next()
- {
-
- $this->index ++;
- }
-
- public function key()
- {
-
- return $this->index;
- }
-
- public function rewind()
- {
-
- $this->index = 0;
- }
-
- public function valid()
- {
-
- return $this->index < count($this->ids);
- }
- }
|