* 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
*
protected function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
-
- // Set part description
- $this->setObjectDescription("Standart-Controller für alle übrigen Anfragen");
-
- // Create unique ID number
- $this->createUniqueID();
-
- // Clean up a little
- $this->removeSystemArray();
}
/**
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
*
*/
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);