Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
ValidatorDate Class Reference
Inheritance diagram for ValidatorDate:
ValidatorRegExp Validator

Public Member Functions

 getRegexp ($dateFormat=DATE_FORMAT_ISO)
 
 isValid ($value, $minScope=VALIDATOR_DATE_SCOPE_YEAR, $maxScope=VALIDATOR_DATE_SCOPE_DAY)
 
 ValidatorDate ($dateFormat=DATE_FORMAT_ISO)
 
- Public Member Functions inherited from ValidatorRegExp
 getMatches ()
 
 isValid ($value)
 
 ValidatorRegExp ($regExp)
 
- Public Member Functions inherited from Validator
 isValid ($value)
 
 Validator ()
 

Detailed Description

Validation check for dates. Accepts truncated dates, such as year, or year and month.

See Also
Validator

Definition at line 24 of file ValidatorDate.inc.php.

Member Function Documentation

ValidatorDate::getRegexp (   $dateFormat = DATE_FORMAT_ISO)

Return the regex for a date check. This can be called statically.

Parameters
$dateFormatinteger one of the DATE_FORMAT_* ids.
Returns
string

Definition at line 74 of file ValidatorDate.inc.php.

Referenced by ValidatorDate().

ValidatorDate::isValid (   $value,
  $minScope = VALIDATOR_DATE_SCOPE_YEAR,
  $maxScope = VALIDATOR_DATE_SCOPE_DAY 
)
See Also
Validator::isValid()
Parameters
$valuemixed
$minScopeint The minimum date resolution allowed, e.g. VALIDATOR_DATE_SCOPE_MONTH will allow YYYY-MM or YYYY-MM-DD, but not YYYY
$maxScopeint The maximum date resolution allowed, e.g. VALIDATOR_DATE_SCOPE_MONTH will allow YYYY or YYYY-MM, but not YYYY-MM-DD
Returns
boolean

Definition at line 43 of file ValidatorDate.inc.php.

References ValidatorRegExp\getMatches().

ValidatorDate::ValidatorDate (   $dateFormat = DATE_FORMAT_ISO)

Constructor.

Definition at line 28 of file ValidatorDate.inc.php.

References getRegexp().


The documentation for this class was generated from the following file: