IsRegExPattern
extends Base
in package
Validator base class.
Table of Contents
Properties
- $_pattern : string
Methods
- __construct() : mixed
- getPattern() : string
- Returns the regex pattern.
- isValid() : bool
- Returns true if validation is successful
- setPattern() : void
- Sets the regex pattern.
- validate() : bool
- Abstract method to be implemented by all validators.
Properties
$_pattern
private
string
$_pattern
Methods
__construct()
public
__construct(mixed $pattern) : mixed
Parameters
- $pattern : mixed
getPattern()
Returns the regex pattern.
public
getPattern() : string
Return values
stringisValid()
Returns true if validation is successful
public
isValid(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolsetPattern()
Sets the regex pattern.
public
setPattern(string $pattern) : void
Parameters
- $pattern : string
validate()
Abstract method to be implemented by all validators.
protected
validate(mixed $value) : bool
Parameters
- $value : mixed