]> git.mxchange.org Git - hub.git/blobdiff - inc/classes/main/controller/default/class_WebDefaultController.php
Code merge from latest ship-simu code
[hub.git] / inc / classes / main / controller / default / class_WebDefaultController.php
index 9830891940ee7417009244ca9ca43d72b412032d..9d60e6178668eea76ec086bc6b3fe76fca8d5188 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class WebWebDefaultController extends BaseController implements Controller {
-       /**
-        * Instance of a CommandResolver class
-        */
-       private $resolverInstance = null;
-
        /**
         * Protected constructor
         *
@@ -37,13 +32,10 @@ class WebWebDefaultController extends BaseController implements Controller {
                parent::__construct(__CLASS__);
 
                // Set part description
-               $this->setObjectDescription("Standart-Controller f&uuml;r alle &uuml;brigen Anfragen");
+               $this->setObjectDescription("Default controller for all other requests");
 
                // Create unique ID number
                $this->createUniqueID();
-
-               // Clean up a little
-               $this->removeSystemArray();
        }
 
        /**
@@ -63,16 +55,6 @@ class WebWebDefaultController extends BaseController implements Controller {
                return $controllerInstance;
        }
 
-       /**
-        * Setter for a command resolver instance
-        *
-        * @param       $resolverInstance       An instance of a command resolver class
-        * @return      void
-        */
-       public final function setResolverInstance (CommandResolver $resolverInstance) {
-               $this->resolverInstance = $resolverInstance;
-       }
-
        /**
         * Handles the given request and response
         *
@@ -82,7 +64,10 @@ class WebWebDefaultController extends BaseController implements Controller {
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the command instance
-               $commandInstance = $this->resolverInstance->resolvCommandByRequest($requestInstance);
+               $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);