]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/factories/class_BaseFactory.php
More smaller fixes, factory added to ship-simu
[shipsimu.git] / inc / classes / main / factories / class_BaseFactory.php
index 11c8ec960649c541d8d78cd127a4f13cf0994ff2..db2611c28913aa784557c8d4b945eda19865cf59 100644 (file)
  */
 class BaseFactory extends BaseFrameworkSystem {
        /**
-        * Private constructor
+        * An instance of the real factory class
+        */
+       private $realFactoryInstance = null;
+
+       /**
+        * Protected constructor
         *
         * @param       $class  Name of the real class (not BaseFactory)
         * @return      void
@@ -32,10 +37,32 @@ class BaseFactory extends BaseFrameworkSystem {
                // Call parent constructor
                parent::__construct($class);
 
+               // Create unique ID number
+               $this->createUniqueID();
+
                // Clean up a little
                $this->removeNumberFormaters();
                $this->removeSystemArray();
        }
+
+       /**
+        * Setter for the *real* factory instance
+        *
+        * @param       $realFactoryInstance    An instance of the real factory class
+        * @return      void
+        */
+       public final function setRealFactoryInstance (BaseFrameworkSystem $realFactoryInstance) {
+               $this->realFactoryInstance = $realFactoryInstance;
+       }
+
+       /**
+        * Getter for the *real* factory instance
+        *
+        * @return      $realFactoryInstance    An instance of the real factory class
+        */
+       protected final function getRealFactoryInstance () {
+               return $this->realFactoryInstance;
+       }
 }
 
 // [EOF]