Location: PHPKode > projects > Neobill > NeoBill0.5.6/validators/DomainServicePriceValidator.class.php
<?php
/**
 * DomainServicePriceValidator.class.php
 *
 * This file contains the definition of the DomainServicePriceValidator 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
 */

/**
 * DomainServicePriceValidator
 *
 * @package SolidWorks
 * @author John Diamond <hide@address.com>
 */
class DomainServicePriceValidator extends FieldValidator {
	/**
	 * Validate a Domain Service Price
	 *
	 * Verifies that the domain service price exists.
	 *
	 * @param string $data Field data
	 * @return DomainServiceDBO DomainService DBO for this DomainService ID
	 * @throws RecordNotFoundException
	 */
	public function validate( $data ) {
		$data = parent::validate( $data );

		$id = explode( "-", $data );
		try {
			$priceDBO = load_DomainServicePriceDBO( $id[0],
					$id[1],
					intval( $id[2] ) );
		}
		catch ( DBNoRowsFoundException $e ) {
			throw new RecordNotFoundException( "DomainServicePrice" );
		}

		return $priceDBO;
	}
}
?>
Return current item: Neobill