More renamed
[shipsimu.git] / application / ship-simu / main / personell / class_SimulatorPersonell.php
index 91916e580b1d80d3237ffa5181a057be68476fbc..8ff01e74d4c4d875da0fa71c953e86e1ab63a239 100644 (file)
@@ -2,11 +2,11 @@
 /**
  * The general simulator personell class
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.shipsimu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,15 +39,6 @@ class SimulatorPersonell extends BasePersonell {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set description
-               $this->setObjectDescription("Simulationspersonal");
-
-               // Create unique ID
-               $this->generateUniqueId();
-
-               // Clean-up a little
-               $this->removeSystemArray();
        }
 
        /**
@@ -63,7 +54,6 @@ class SimulatorPersonell extends BasePersonell {
                $this->removePersonellList();
                $this->removeMinMaxAge();
                $this->removeCache();
-               $this->removeSystemArray();
        }
 
        /**
@@ -74,7 +64,7 @@ class SimulatorPersonell extends BasePersonell {
         * @return      $personellInstance              An instance of this object with a
         *                                                              list of personells
         */
-       public final static function createSimulatorPersonell ($amountPersonell) {
+       public static final function createSimulatorPersonell ($amountPersonell) {
                // Make sure only integer can pass
                $amountPersonell = (int) $amountPersonell;
 
@@ -110,9 +100,7 @@ class SimulatorPersonell extends BasePersonell {
                $personellInstance->removeSalary();
                $personellInstance->removeEmployed();
                $personellInstance->removeMarried();
-               $personellInstance->removeNumberFormaters();
                //$personellInstance->removeCache();
-               $personellInstance->removeSystemArray();
 
                // Instanz zurueckgeben
                return $personellInstance;
@@ -127,51 +115,12 @@ class SimulatorPersonell extends BasePersonell {
         * @throws      InvalidIDFormatException        If the given id number
         *                                                                              $idNumber is invalid
         * @throws      MissingSimulatorIdException             If an ID number was not found
+        * @deprecated
         */
-       public final static function createSimulatorPersonellByID ($idNumber) {
-               // Use the direct ID number
-               $tempID = $idNumber;
-
-               // Add the class name if it was not found
-               if (count(explode("@", $idNumber)) < 2) {
-                       // Add class name in front of the incomplete ID number
-                       $tempID = sprintf("%s@%s", __CLASS__, $idNumber);
-               } // END - if
-
-               // Validate the ID number
-               if (!preg_match(sprintf("/%s\@([a-f0-9]){32}/i", __CLASS__), $tempID)) {
-                       // Invalid format
-                       throw new InvalidIDFormatException(new SimulatorPersonell(), self::EXCEPTION_ID_IS_INVALID_FORMAT);
-               } // END - if
-
+       public static final function createSimulatorPersonellByID ($idNumber) {
                // Get instance
                $personellInstance = new SimulatorPersonell(false);
-
-               // Get database instance
-               $dbInstance = $personellInstance->getDatabaseInstance();
-
-               // Is the unique ID already used? Then it must be there!
-               if (!$dbInstance->isUniqueIdUsed($tempID))  {
-                       // Entry not found!
-                       throw new MissingSimulatorIdException(array($personellInstance, $idNumber), self::EXCEPTION_SIMULATOR_ID_INVALID);
-               } // END - if
-
-               // Load the personell list and add it to this object
-               $personellInstance->loadPersonellList($tempID);
-
-               // Clean-up a little
-               $personellInstance->removeGender();
-               $personellInstance->removeNames();
-               $personellInstance->removeBirthday();
-               $personellInstance->removeSalary();
-               $personellInstance->removeEmployed();
-               $personellInstance->removeMarried();
-               $personellInstance->removeNumberFormaters();
-               //$personellInstance->removeCache();
-               $personellInstance->removeSystemArray();
-
-               // Return instance
-               return $personellInstance;
+               $personellInstance->makeDeprecated();
        }
 
        // Create personell list
@@ -212,7 +161,6 @@ class SimulatorPersonell extends BasePersonell {
                $personellInstance->removePersonellList();
                $personellInstance->removeMinMaxAge();
                $personellInstance->removeCache();
-               $personellInstance->removeSystemArray();
 
                // Add new member to the list
                $this->personellList->append($personellInstance);
@@ -368,16 +316,10 @@ class SimulatorPersonell extends BasePersonell {
         * @param       $idNumber       The ID number we shall use for looking up
         *                                              the right data.
         * @return      void
-        * @throws      ContainerItemIsNullException    If a container item is null
-        * @throws      ContainerItemIsNoArrayException If a container item is
-        *                                                                                      not an array
-        * @throws      ContainerMaybeDamagedException  If the container item
-        *                                                                                      is missing the indexes
-        *                                                                                      'name' and/or 'value'
+        * @deprecated
         */
        public function loadPersonellList ($idNumber) {
-               // Cleared because old code
-               $this->partialStub("Cleared because old lost code was used.");
+               $this->makeDeprecated();
        }
 }