Validate/Date.php

Show: PublicProtectedPrivateinherited
Table of Contents
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
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

>VConstant  INVALID = 'dateInvalid'
>VConstant  INVALID_DATE = 'dateInvalidDate'
>VConstant  FALSEFORMAT = 'dateFalseFormat'

Properties

>VPropertyprotectedstring|null $_format
Optional format
Details
Type
string | null
>VPropertyprotectedstring|\Zend_Locale|null $_locale
Optional locale
Details
Type
string | \Zend_Locale | null
>VPropertyprotectedarray $_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 valuearray(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
>VPropertyprotectedarray $_messageVariables = array('format' => '_format')
Default valuearray('format' => '_format')Details
Type
array

Methods

methodpublic__construct(string | \Zend_Config $options = array()) : void

Sets validator options

Parameters
NameTypeDescription
$optionsstring | \Zend_Config

OPTIONAL

methodprivate_checkFormat(string $value) : boolean

Check if the given date fits the given format

Parameters
NameTypeDescription
$valuestring

Date to check

Returns
TypeDescription
booleanFalse when date does not fit the format
methodpublicgetFormat() : string | null

Returns the locale option

Returns
TypeDescription
string | null
methodpublicgetLocale() : string | \Zend_Locale | null

Returns the locale option

Returns
TypeDescription
string | \Zend_Locale | null
methodpublicisValid(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()
Parameters
NameTypeDescription
$valuestring | array | \Zend_Date
Returns
TypeDescription
boolean
methodpublicsetFormat(string $format = null) : \Zend_Validate_Date

Sets the format option

Parameters
NameTypeDescription
$formatstring
Returns
TypeDescription
\Zend_Validate_Dateprovides a fluent interface
methodpublicsetLocale(string | \Zend_Locale $locale = null) : \Zend_Validate_Date

Sets the locale option

Parameters
NameTypeDescription
$localestring | \Zend_Locale
Returns
TypeDescription
\Zend_Validate_Dateprovides a fluent interface
Documentation was generated by phpDocumentor 2.2.0 .