$iterator->seek($pos);
// Is the current position valid?
- if ($iterator->valid()) {
- // Element holen
- $employee = $iterator->current();
- } else {
+ if (!$iterator->valid()) {
// Should normally not happen... :(
throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
- }
- }
+ } // END - if
+
+ // Get current element
+ $employee = $iterator->current();
+ } // END - while
// A dummy just for the description and real class
$dummy = CompanyEmployee::createCompanyEmployee("", "", "M", 1970, 1, 1, $employee->isMarried(), 0);