A lot more old methods deprecated and already deprecated methods removed
authorRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 16:21:53 +0000 (16:21 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 16:21:53 +0000 (16:21 +0000)
application/ship-simu/main/personell/class_SimulatorPersonell.php
application/ship-simu/main/personell/company/class_CompanyEmployee.php
application/ship-simu/main/ships/passenger/class_PassengerShip.php
inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php
inc/classes/interfaces/extended/class_LimitableObject.php
inc/classes/main/database/class_BaseDatabaseFrontend.php
inc/classes/main/database/databases/class_LocalFileDatabase.php

index 2aabd8b328a1d1972c7a89b9ed2f5145e62f003c..f0b33b8a43905d2a255caeb1f0b1801b40d0e7bd 100644 (file)
@@ -386,25 +386,6 @@ class SimulatorPersonell extends BasePersonell {
                return $surname;
        }
 
-       /**
-        * Saves only the personell list to the database
-        *
-        * @return      void
-        */
-       public function saveObjectToDatabase () {
-               // Get the database
-               $dbInstance = $this->getDatabaseInstance();
-
-               // Prepare the limitation object. We just need the personellList array object.
-               $limitInstance = ObjectLimits::createObjectLimits(array("personellList"));
-
-               // Limitate the saving amount
-               $dbInstance->limitObject($limitInstance);
-
-               // Save this object
-               $dbInstance->saveObject($this);
-       }
-
        /**
         * Getter for personell list
         *
index 467721893b9046c426dfb4d1fa03f3cafc7a9fcb..06fcd7cba977d6359c7f5eb73a725d623fe8a27d 100644 (file)
@@ -94,20 +94,6 @@ class CompanyEmployee extends SimulatorPersonell {
                }
                unset($this->employeeList);
        }
-
-       /**
-        * Call parent method
-        */
-       public function saveObjectToDatabase () {
-               parent::saveObjectToDatabase();
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               parent::limitObject($limitInstance);
-       }
 }
 
 // [EOF]
index cbe0a2225b5cc20dbd45bbeaaa1e5cde606a5941..f2ac31a9b143876deacba27359dbcd29213e470c 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class PassengerShip extends BaseShip implements ConstructableShip, LimitableObject {
+class PassengerShip extends BaseShip implements ConstructableShip {
        // Konstruktor
        protected function __construct () {
                // Eltern-Kontruktor aufrufen
@@ -121,20 +121,6 @@ class PassengerShip extends BaseShip implements ConstructableShip, LimitableObje
                // Anzahl zurueckliefern
                return $numBeds;
        }
-
-       /**
-        * Reduces the volume of a processed object.
-        *
-        * @param       $limitInstance  An instance to ObjectLimits which holds
-        *                      attribute names that we want to include in the processing phase.
-        *                      Other attributes except $uniqueID and $realClass will be ignored
-        *                      and keept out.
-        * @return      void
-        */
-       function limitObject (ObjectLimits $limitInstance) {
-               // Work in progress
-               $this->partialStub("Unfinished method called.");
-       }
 }
 
 // [EOF]
index 81ca81d3b2601d6eeacd5aee645578dde27b7ded..78f30ff66005384808337ba7c95a567a9cf044cd 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
-       /**
-        * Loads data saved with saveObject from the database and re-creates a
-        * full object from it.
-        * If limitObject() was called before a new object ObjectContainer with
-        * all requested attributes will be returned instead.
-        *
-        * @return      Object  The fully re-created object or instance to
-        *                                      ObjectContainer
-        * @deprecated
-        */
-       function loadObject ();
-
        /**
         * Makes sure that the database connection is up and alive
         *
index d4eea0f4441ab9c6d5f6f5dc0fdcabb46d7686ad..9c03202847b7caea7b781d4c7323856502f2d658 100644 (file)
@@ -8,6 +8,7 @@
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
+ * @deprecated
  *
  * 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
index 2d2e04bdcf87a4ab38c9844f3483f59304f1ce27..56041e6373b59c98684b7857f5ca46588b981a3e 100644 (file)
@@ -22,7 +22,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface, LimitableObject {
+abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface {
        // Constants for exceptions
        const EXCEPTION_SQL_QUERY = 0x050;
 
@@ -43,34 +43,6 @@ abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements Datab
                // Clean up a little
                $this->removeNumberFormaters();
        }
-
-       /**
-        * Getter for limitation instance
-        *
-        * @return      $limitInstance          The instance to the object ObjectLimits
-        */
-       public final function getLimitInstance () {
-               return $this->limitInstance;
-       }
-
-       /**
-        * Setup limitation for the saving process
-        *
-        * @param               $limitInstance  An instance of ObjectLimits which contains
-        *                                              elements we shall exclusivly include in
-        *                                              saving process
-        * @return      void
-        */
-       public final function limitObject (ObjectLimits $limitInstance) {
-               // Get limitArray for validation
-               $array = $limitInstance->getLimitArray();
-
-               // Sanity-check if some limitations are in the object
-               if ($array->count() > 0) {
-                       // Okay, there is enougth
-                       $this->limitInstance = $limitInstance;
-               }
-       }
 }
 
 // [EOF]
index 27ba98e66761e46cc89c921bc6859facf91975ca..417c861ea61d8fe5176c156bc87468c0cfab01aa 100644 (file)
@@ -150,60 +150,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->lastException;
        }
 
-       /**
-        * Saves a given object to the local file system by serializing and
-        * transparently compressing it
-        *
-        * @param       $object                                 The object we shall save to the local file system
-        * @return      void
-        * @deprecated
-        */
-       public final function saveObject (FrameworkInterface $object) {
-               // Get a string containing the serialized object. We cannot exchange
-               // $this and $object here because $object does not need to worry
-               // about it's limitations... ;-)
-               $serialized = $this->serializeObject($object);
-
-               // Get a path name plus file name and append the extension
-               $fqfn = $this->getSavePath() . $object->getPathFileNameFromObject() . "." . $this->getFileExtension();
-
-               // Save the file to disc we don't care here if the path is there,
-               // this must be done in later methods.
-               $this->getFileIoInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized));
-       }
-
-       /**
-        * Get a serialized string from the given object
-        *
-        * @param       $object                 The object we want to serialize and transparently
-        *                                                      compress
-        * @return      $serialized             A string containing the serialzed/compressed object
-        * @see         ObjectLimits    An object holding limition information
-        * @see         SerializationContainer  A special container class for e.g.
-        *                                                                      attributes from limited objects
-        * @deprecated
-        */
-       private function serializeObject (FrameworkInterface $object) {
-               // If there is no limiter instance we serialize the whole object
-               // otherwise only in the limiter object (ObjectLimits) specified
-               // attributes summarized in a special container class
-               if ($this->getLimitInstance() === null) {
-                       // Serialize the whole object. This tribble call is the reason
-                       // why we need a fall-back implementation in CompressorChannel
-                       // of the methods compressStream() and decompressStream().
-                       $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($object));
-               } else {
-                       // Serialize only given attributes in a special container
-                       $container = SerializationContainer::createSerializationContainer($this->getLimitInstance(), $object);
-
-                       // Serialize the container
-                       $serialized = $this->getCompressorChannel()->getCompressor()->compressStream(serialize($container));
-               }
-
-               // Return the serialized object string
-               return $serialized;
-       }
-
        /**
         * Analyses if a unique ID has already been used or not by search in the
         * local database folder.
@@ -371,6 +317,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         *                                                                      is not an object instance
         * @throws      MissingMethodException  If the required method
         *                                                                      toString() is missing
+        * @deprecated
         */
        public final function getObjectFromCachedData ($uniqueID) {
                // Get instance for file handler
@@ -416,13 +363,14 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        /**
         * Private method for re-gathering (repairing) the FQFN
         *
-        * @param               $fqfn           The current FQFN we shall validate
-        * @param               $uniqueID               The unique ID number
+        * @param       $fqfn           The current FQFN we shall validate
+        * @param       $uniqueID       The unique ID number
         * @return      $fqfn           The repaired FQFN when it is empty
         * @throws      NoArrayCreatedException         If explode() has not
-        *                                                                      created an array
+        *                                                                              created an array
         * @throws      InvalidArrayCountException      If the array count is not
-        *                                                                      as the expected
+        *                                                                              as the expected
+        * @deprecated
         */
        private function repairFQFN ($fqfn, $uniqueID) {
                // Cast both strings
@@ -461,6 +409,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * @param               $contents               The (maybe) already cached contents as an array
         * @param               $fqfn           The current FQFN we shall validate
         * @return      $contents               The repaired contents from the given file
+        * @deprecated
         */
        private function repairContents ($contents, $fqfn) {
                // Is there some content and header (2 indexes) in?
@@ -533,48 +482,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                /* @TODO Do some checks on the database directory and files here */
        }
 
-       /**
-        * Loads data saved with saveObject from the database and re-creates a
-        * full object from it.
-        * If limitObject() was called before a new object ObjectContainer with
-        * all requested attributes will be returned instead.
-        *
-        * @return      Object  The fully re-created object or instance to
-        *                                      ObjectContainer
-        * @throws      SavePathIsEmptyException                If the given save path is an
-        *                                                                                      empty string
-        * @throws      SavePathIsNoDirectoryException  If the save path is no
-        *                                                                                      path (e.g. a file)
-        * @throws      SavePathReadProtectedException  If the save path is read-
-        *                                                                                      protected
-        * @throws      SavePathWriteProtectedException If the save path is write-
-        *                                                                                      protected
-        */
-       public function loadObject () {
-               // Already connected? Then abort here
-               if ($this->alreadyConnected === true) return true;
-
-               // Get the save path
-               $savePath = $this->getSavePath();
-
-               if (empty($savePath)) {
-                       // Empty string
-                       throw new SavePathIsEmptyException($dbInstance, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!is_dir($savePath)) {
-                       // Is not a dir
-                       throw new SavePathIsNoDirectoryException($savePath, self::EXCEPTION_INVALID_PATH_NAME);
-               } elseif (!is_readable($savePath)) {
-                       // Path not readable
-                       throw new SavePathReadProtectedException($savePath, self::EXCEPTION_READ_PROTECED_PATH);
-               } elseif (!is_writeable($savePath)) {
-                       // Path not writeable
-                       throw new SavePathWriteProtectedException($savePath, self::EXCEPTION_WRITE_PROTECED_PATH);
-               }
-
-               // "Connection" established... ;-)
-               $this->alreadyConnected = true;
-       }
-
        /**
         * Starts a SELECT query on the database by given return type, table name
         * and search criteria