class_RulesAcceptedFilter.php

Go to the documentation of this file.
00001 <?php
00026 class RulesAcceptedFilter extends BaseFilter implements Filterable {
00032         protected function __construct () {
00033                 // Call parent constructor
00034                 parent::__construct(__CLASS__);
00035         }
00036 
00042         public final static function createRulesAcceptedFilter () {
00043                 // Get a new instance
00044                 $filterInstance = new RulesAcceptedFilter();
00045 
00046                 // Return the instance
00047                 return $filterInstance;
00048         }
00049 
00057         public function execute (Requestable $requestInstance, Responseable $responseInstance) {
00058                 // Get the "rules" value from request
00059                 $rules = $requestInstance->getRequestElement('rules');
00060 
00061                 // Was the "rules" value found in form? And is it set?
00062                 if (is_null($rules)) {
00063                         // Not found in form so stop processing here
00064                         $requestInstance->requestIsValid(false);
00065 
00066                         // Add a message to the response
00067                         $responseInstance->addFatalMessage('rules_unchecked');
00068 
00069                         // Skip further processing
00070                         return false;
00071                 }
00072         }
00073 }
00074 
00075 // [EOF]
00076 ?>

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