Validate/Date.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Validate
- Version
- $Id$
\Zend_Validate_Date
Package: Zend_Validate




Returns


- Parent(s)
- \Zend_Validate_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties


array $_messageTemplates = array(self::INVALID => "Invalid type given. String, integer, array or Zend_Date expected", self::INVALID_DATE => "'%value%' does not appear to be a valid date", self::FALSEFORMAT => "'%value%' does not fit the date format '%format%'")
Validation failure message template definitions
Default value
array(self::INVALID => "Invalid type given. String, integer, array or Zend_Date expected", self::INVALID_DATE => "'%value%' does not appear to be a valid date", self::FALSEFORMAT => "'%value%' does not fit the date format '%format%'")
Details- Type
- array
Methods


__construct(string | \Zend_Config $options = array()) : void
Sets validator options
Parameters
Name | Type | Description |
---|---|---|
$options | string | \Zend_Config | OPTIONAL |


_checkFormat(string $value) : boolean
Check if the given date fits the given format
Parameters
Returns
Name | Type | Description |
---|---|---|
$value | string | Date to check |
Type | Description |
---|---|
boolean | False when date does not fit the format |


getLocale() : string | \Zend_Locale | null
Returns the locale option
Returns
Type | Description |
---|---|
string | \Zend_Locale | null |


isValid(string | array | \Zend_Date $value) : boolean
Defined by Zend_Validate_Interface
Returns true if $value is a valid date of the format YYYY-MM-DD
If optional $format or $locale is set the date format is checked
according to Zend_Date, see Zend_Date::isDate()
ParametersName | Type | Description |
---|---|---|
$value | string | array | \Zend_Date |
Type | Description |
---|---|
boolean |


setFormat(string $format = null) : \Zend_Validate_Date
Sets the format option
Parameters
Returns
Name | Type | Description |
---|---|---|
$format | string |
Type | Description |
---|---|
\Zend_Validate_Date | provides a fluent interface |


setLocale(string | \Zend_Locale $locale = null) : \Zend_Validate_Date
Sets the locale option
Parameters
Returns
Name | Type | Description |
---|---|---|
$locale | string | \Zend_Locale |
Type | Description |
---|---|
\Zend_Validate_Date | provides a fluent interface |