Code merge from latest ship-simu code
[mailer.git] / inc / classes / main / resolver / class_BaseResolver.php
index d442ef38e465b9cb9d926912e67879aad2e2b8b4..9345109a8ac24b99b46e841dc6daf41cd6cd7f60 100644 (file)
@@ -33,7 +33,12 @@ class BaseResolver extends BaseFrameworkSystem {
        private $commandPrefix = "";
 
        /**
-        * Private constructor
+        * A controller instance
+        */
+       private $controllerInstance = null;
+
+       /**
+        * Protected constructor
         *
         * @return      void
         */
@@ -42,9 +47,29 @@ class BaseResolver extends BaseFrameworkSystem {
                parent::__construct($class);
 
                // Clean up a little
+               $this->removeNumberFormaters();
                $this->removeSystemArray();
        }
 
+       /**
+        * Setter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @param       $controllerInstance             An instance of the controller
+        * @return      void
+        */
+       public final function setControllerInstance (Controller $controllerInstance) {
+               $this->controllerInstance = $controllerInstance;
+       }
+
+       /**
+        * Getter for controller instance (this surely breaks a bit the MVC patterm)
+        *
+        * @return      $controllerInstance             An instance of the controller
+        */
+       public final function getControllerInstance () {
+               return $this->controllerInstance;
+       }
+
        /**
         * Setter for command name
         *
@@ -94,7 +119,7 @@ class BaseResolver extends BaseFrameworkSystem {
                // Now, let us create the full name of the command class
                $class = sprintf("%s%sCommand",
                        $this->commandPrefix,
-                       ucfirst(strtolower($commandName))
+                       $this->convertToClassName($commandName)
                );
 
                // Is this class already loaded?
@@ -103,6 +128,13 @@ class BaseResolver extends BaseFrameworkSystem {
                        $isValid = true;
                }
 
+               // Debug output
+               //echo "<strong>----- ".__METHOD__." -----</strong><br />\n";
+               //print($class."<pre>");
+               //debug_print_backtrace();
+               //var_dump($isValid);
+               //print("</pre>");
+
                // Set command name
                $this->setCommandName($commandName);