- // Get database instance
- $dbInstance = $this->getDatabaseInstance();
-
- // Get the serialization container within the personell list from
- // the database layer
- $containerInstance = $dbInstance->getObjectFromCachedData($idNumber);
-
- // Iterate through the whole container
- for ($idx = $containerInstance->getIterator(); $idx->valid(); $idx->next()) {
- // Get current item from container
- $item = $idx->current();
-
- // Validate it a bit
- if (is_null($item)) {
- // Is null
- throw new ContainerItemIsNullException($this, self::EXCEPTION_CONTAINER_ITEM_IS_NULL);
- } elseif (!is_array($item)) {
- // Is not an array
- throw new ContainerItemIsNoArrayException($this, self::EXCEPTION_ITEM_IS_NO_ARRAY);
- } elseif ((!isset($item['name'])) || (!isset($item['value']))) {
- // Missing elements
- throw new ContainerMaybeDamagedException($this, self::EXCEPTION_CONTAINER_MAYBE_DAMAGED);
- }
-
- // Okay, now we can get the item and generate a valid command for eval().
- // We need to convert the first letter to lower-case but keep all others intact
- $eval = sprintf("\$this->%s = \$item['value'];",
- strtolower(substr($item['name'], 0, 1))
- .
- substr($item['name'], 1)
- );
-
- // Debug message
- if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruierte PHP-Anweisung: <pre><em>%s</em></pre><br />\n",
- __CLASS__,
- __LINE__,
- htmlentities($eval)
- ));
-
- // Run the command
- @eval($eval);
- }