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

30 lines
736 B
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?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]);
}
}
?>