| 1 | <?php |
||
| 11 | class Set implements Iterator |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Position of the iteration |
||
| 15 | * |
||
| 16 | * @var int |
||
| 17 | **/ |
||
| 18 | private $position = 0; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Parameters |
||
| 22 | * |
||
| 23 | * @var Parameter[] |
||
| 24 | **/ |
||
| 25 | private $parameters = array(); |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Add a new parameter |
||
| 29 | * |
||
| 30 | * @param string $name name of the parameter |
||
| 31 | * @param string $description (optional) human readable description |
||
| 32 | * @return Set |
||
| 33 | **/ |
||
| 34 | public function add($name, $description = null) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Is there a parameter with name $name? |
||
| 43 | * |
||
| 44 | * @param string $name |
||
| 45 | * @return bool |
||
| 46 | **/ |
||
| 47 | public function has($name) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get a parameter by name |
||
| 60 | * |
||
| 61 | * @param string $name |
||
| 62 | * @return Parameter |
||
| 63 | **/ |
||
| 64 | public function get($name) |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Rewind iterator |
||
| 80 | * |
||
| 81 | * @return void |
||
| 82 | **/ |
||
| 83 | public function rewind() |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Get current parameter |
||
| 90 | * |
||
| 91 | * @return Parameter |
||
| 92 | **/ |
||
| 93 | public function current() |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Get current key |
||
| 100 | * |
||
| 101 | * @return int |
||
| 102 | **/ |
||
| 103 | public function key() |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Go to next position |
||
| 110 | * |
||
| 111 | * @return void |
||
| 112 | **/ |
||
| 113 | public function next() |
||
| 117 | |||
| 118 | /** |
||
| 119 | * Is the iterator in a valid position? |
||
| 120 | * |
||
| 121 | * @return bool |
||
| 122 | **/ |
||
| 123 | public function valid() |
||
| 127 | } |
||
| 128 |