]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/controller/default/class_WebDefaultController.php
From group >unknown< fixed
[shipsimu.git] / inc / classes / main / controller / default / class_WebDefaultController.php
index 3256f461d8b928d988b5914375a49e7f85f35e55..ec56fdd9fb64461c8130014af9ecf7a36a9d5d5b 100644 (file)
  */
 class WebWebDefaultController extends BaseController implements Controller {
        /**
-        * Instance of a CommandResolver class
-        */
-       private $resolverInstance = null;
-
-       /**
-        * Private constructor
+        * Protected constructor
         *
         * @return      void
         */
@@ -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();
+               $this->generateUniqueId();
        }
 
        /**
@@ -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,13 +64,16 @@ 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);
 
                // Flush the response out
-               $responseInstance->flushResponse();
+               $responseInstance->flushBuffer();
        }
 }