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/valid.php
2011-07-18 16:20:55 +10:00

28 lines
726 B
PHP

<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Array and variable validation.
*
* @package lnApp/Modifications
* @category Classes
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Valid extends Kohana_Valid {
/**
* Checks if a field matches the value of another field, if it is set.
* Field is ignored if it is blank.
*
* @param array array of values
* @param string field name
* @param string field name to match
* @return boolean
*/
public static function matches_ifset($array, $field, $match)
{
return isset($array[$match]) ? ($array[$field] === $array[$match]) : TRUE;
}
}
?>