コード例 #1
0
 /**
  * Validate search criteria.
  */
 function validateCriteria()
 {
     $type_of_data = $this->criteria['global']['type_of_data'];
     if (!isset($this->criteria['global']['records_from'])) {
         $this->criteria['global']['records_from'] = 1;
     }
     $records_from = $this->criteria['global']['records_from'];
     if (!isset($this->criteria['global']['max_records'])) {
         $this->criteria['global']['max_records'] = $this->getMaxAllowedTransactionResults();
     }
     $max_records = $this->criteria['global']['max_records'];
     $response_format = $this->criteria['global']['response_format'];
     if (!isset($type_of_data)) {
         $this->addError(1000, array('@paramName' => 'type_of_data'));
     } else {
         if (!in_array($type_of_data, ValidatorConfig::$domains)) {
             $this->addError(1001, array('@value' => $type_of_data, '@paramName' => 'type_of_data', '@validValues' => implode(',', ValidatorConfig::$domains)));
         }
     }
     if (!in_array($response_format, ValidatorConfig::$response_formats)) {
         $this->addError(1001, array('@value' => $response_format, '@paramName' => 'response_format', '@validValues' => implode(',', ValidatorConfig::$response_formats)));
     }
     $this->validateResultRecordRange($records_from, $max_records);
     if (!$this->hasErrors()) {
         $domain_config = ConfigUtil::getDomainConfiguration(strtolower($type_of_data));
         $this->validateDomainCriteria($type_of_data, $domain_config);
     }
 }