<?php
/**
* TaxRuleValidator.class.php
*
* This file contains the definition of the TaxRuleValidator class.
*
* @package SolidWorks
* @author John Diamond <hide@address.com>
* @copyright John Diamond <hide@address.com>
* @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
*/
/**
* TaxRuleValidator
*
* @package SolidWorks
* @author John Diamond <hide@address.com>
*/
class TaxRuleValidator extends FieldValidator {
/**
* Validate a TaxRule ID
*
* Verifies that the TaxRule exists.
*
* @param string $data Field data
* @return TaxRuleDBO TaxRule DBO for this TaxRule ID
* @throws RecordNotFoundException
*/
public function validate( $data ) {
$data = parent::validate( $data );
try {
$taxRuleDBO = load_TaxRuleDBO( intval( $data ) );
}
catch ( DBNoRowsFoundException $e ) {
throw new RecordNotFoundException( "TaxRule" );
}
return $taxRuleDBO;
}
}
?>