X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fpersonell%2Fclass_SimulatorPersonell.php;h=08d69386eda6641c0d67d4a748c146b26ba49bed;hb=dbcca4302701f2adb974660901d4b32c3f633eac;hp=9cc0adbf00883678f3a06a6c04bc9ceadb6e3d34;hpb=2ab27850ef2171954c7e04e79b4978154468251c;p=shipsimu.git diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php index 9cc0adb..08d6938 100644 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ b/application/ship-simu/main/personell/class_SimulatorPersonell.php @@ -122,16 +122,11 @@ class SimulatorPersonell extends BasePersonell { * Create a SimulatorPersonell object by loading the specified personell * list from an existing database backend * - * @param $idNumber The ID number (only right part) of the list - * @return $personellInstance An instance of - * @throws InvalidIDFormatException If the given id number - * $idNumber is invalid - * @throws NullPointerException If a null pointer (instance) - * has been returned. - * @throws NoObjectException If a non-object has been - * returned - * @throws MissingMethodException If a required method is missing - * @throws MissingSimulatorIDException If an ID number was not found + * @param $idNumber The ID number (only right part) of the list + * @return $personellInstance An instance of this class + * @throws InvalidIDFormatException If the given id number + * $idNumber is invalid + * @throws MissingSimulatorIdException If an ID number was not found */ public final static function createSimulatorPersonellByID ($idNumber) { // Add the class name if it was not found @@ -155,22 +150,10 @@ class SimulatorPersonell extends BasePersonell { // Get database instance $dbInstance = $personellInstance->getDatabaseInstance(); - // Is this a valid database instance? - if (is_null($dbInstance)) { - // No class returned - throw new NullPointerException($personellInstance, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($dbInstance)) { - // Not an object! ;-( - throw new NoObjectException($dbInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!method_exists($dbInstance, 'isUniqueIdUsed')) { - // Required method not found - throw new MissingMethodException(array($dbInstance, 'isUniqueIdUsed'), self::EXCEPTION_MISSING_METHOD); - } - // 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); + throw new MissingSimulatorIdException(array($personellInstance, $idNumber), self::EXCEPTION_SIMULATOR_ID_INVALID); } // Load the personell list and add it to this object