class_WebConfirmController.php

Go to the documentation of this file.
00001 <?php
00024 class WebConfirmController extends BaseController implements Controller {
00030         protected function __construct () {
00031                 // Call parent constructor
00032                 parent::__construct(__CLASS__);
00033         }
00034 
00042         public final static function createWebConfirmController (CommandResolver $resolverInstance) {
00043                 // Create the instance
00044                 $controllerInstance = new WebConfirmController();
00045 
00046                 // Set the command resolver
00047                 $controllerInstance->setResolverInstance($resolverInstance);
00048 
00049                 // Add filters for handling confirmation code and username
00050                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
00051                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_unconfirmed_filter'));
00052                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('confirm_code_verifier_filter'));
00053                 $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_confirmed_filter'));
00054 
00055                 // Return the prepared instance
00056                 return $controllerInstance;
00057         }
00058 
00066         public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
00067                 // Get the command instance from the resolver by sending a request instance to the resolver
00068                 $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
00069 
00070                 // Run the pre filters
00071                 $this->executePreFilters($requestInstance, $responseInstance);
00072 
00073                 // This request was valid! :-D
00074                 $requestInstance->requestIsValid();
00075 
00076                 // Execute the command
00077                 $commandInstance->execute($requestInstance, $responseInstance);
00078 
00079                 // Run the pre filters
00080                 $this->executePostFilters($requestInstance, $responseInstance);
00081 
00082                 // Flush the response out
00083                 $responseInstance->flushBuffer();
00084         }
00085 }
00086 
00087 // [EOF]
00088 ?>

Generated on Mon Dec 8 01:06:45 2008 for Ship-Simulator by  doxygen 1.5.6