00001 <?php 00024 class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filterable { 00030 protected function __construct () { 00031 // Call parent constructor 00032 parent::__construct(__CLASS__); 00033 } 00034 00040 public final static function createRefillRequestValidatorFilter () { 00041 // Get a new instance 00042 $filterInstance = new RefillRequestValidatorFilter(); 00043 00044 // Return the instance 00045 return $filterInstance; 00046 } 00047 00056 public function execute (Requestable $requestInstance, Responseable $responseInstance) { 00057 // Execute the parent execute method 00058 parent::execute($requestInstance, $responseInstance); 00059 00060 // Are all required request fields set? 00061 if (($requestInstance->isRequestElementSet('type') === false) || ($requestInstance->isRequestElementSet('amount') === false)) { 00062 // Something important is missing 00063 $requestInstance->requestIsValid(false); 00064 00065 // Add a message to the response 00066 $responseInstance->addFatalMessage('refill_page_required_fields_missing'); 00067 00068 // Abort here 00069 return false; 00070 } // END - if 00071 00072 // Unfinised part 00073 $this->partialStub("Unfinished method."); 00074 } 00075 } 00076 00077 // [EOF] 00078 ?>
1.5.6