mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 11:32:40 +00:00
adds backwards compatible 'between' alias for 'lengthBetween' validation rule
This commit is contained in:
parent
021d765620
commit
3ac731273e
2 changed files with 16 additions and 2 deletions
|
@ -109,6 +109,20 @@ class Validation {
|
|||
return ($length >= $min && $length <= $max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of Validator::lengthBetween() for backwards compatibility.
|
||||
*
|
||||
* @see Validator::lengthBetween()
|
||||
* @deprecated Deprecated since 2.6, use Validator::lengthBetween() instead.
|
||||
* @param string $check Value to check for length
|
||||
* @param integer $min Minimum value in range (inclusive)
|
||||
* @param integer $max Maximum value in range (inclusive)
|
||||
* @return boolean Success
|
||||
*/
|
||||
public static function between($check, $min, $max) {
|
||||
return self::lengthBetween($check, $min, $max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if field is left blank -OR- only whitespace characters are present in its value
|
||||
* Whitespace characters include Space, Tab, Carriage Return, Newline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue