This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/validate.php
2011-05-03 09:49:04 +10:00

30 lines
736 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Array and variable validation.
*
* @package OSB/Modifications
* @category Classes
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Validate extends Kohana_Validate {
/**
* Checks if a field matches the value of another field, if it is set.
* Field is ignored if it is blank.
*
* This function is only invoked anyway when the value is set as per
* $this->_empty_rules
*
* @param string field value
* @param string field name to match
* @return boolean
*/
protected function matches_ifset($value, $match)
{
return ($value === $this[$match]);
}
}
?>