Zend\Validator\DateStep
Synopsis
class DateStep
extends Date
{
- // constants
- const NOT_STEP = 'dateStepNotStep';
- const FORMAT_DEFAULT = ;
- // Inherited constants from Date
- const INVALID = 'dateInvalid';
- const INVALID_DATE = 'dateInvalidDate';
- const FALSEFORMAT = 'dateFalseFormat';
- const FORMAT_DEFAULT = 'Y-m-d';
- // members
- protected array $messageTemplates;
- protected DateTime $baseValue;
- protected DateInterval $step;
- protected DateTimeZone $timezone;
- // Inherited members from Date
- protected array $messageTemplates;
- protected array $messageVariables;
- protected string $format;
- // Inherited members from AbstractValidator
- protected mixed $value;
- protected TranslatorInterface $defaultTranslator;
- protected string $defaultTranslatorTextDomain;
- protected integer $messageLength;
- protected array $abstractOptions;
- // methods
- public void __construct()
- public DateStep setBaseValue()
- public DateTime getBaseValue()
- public DateStep setStep()
- public DateInterval getStep()
- public DateTimeZone getTimezone()
- public DateStep setTimezone()
- protected void convertString()
- public bool isValid()
- // Inherited methods from Date
- public void __construct()
- public string|null getFormat()
- public Date setFormat()
- public bool isValid()
- protected bool|DateTime convertToDateTime()
- protected bool|DateTime convertInteger()
- protected bool|DateTime convertString()
- protected bool|DateTime convertArray()
- // Inherited methods from AbstractValidator
- public void __construct()
- public mixed getOption()
- public array getOptions()
- public AbstractValidator setOptions()
- public array getMessages()
- public bool __invoke()
- public array getMessageVariables()
- public array getMessageTemplates()
- public AbstractValidator setMessage()
- public AbstractValidator setMessages()
- public mixed __get()
- protected string createMessage()
- protected void error()
- protected mixed getValue()
- protected void setValue()
- public AbstractValidator setValueObscured()
- public bool isValueObscured()
- public AbstractValidator setTranslator()
- public TranslatorInterface|null getTranslator()
- public bool hasTranslator()
- public AbstractValidator setTranslatorTextDomain()
- public string getTranslatorTextDomain()
- public static void setDefaultTranslator()
- public static TranslatorInterface|null getDefaultTranslator()
- public static bool hasDefaultTranslator()
- public static void setDefaultTranslatorTextDomain()
- public static string getDefaultTranslatorTextDomain()
- public AbstractValidator setTranslatorEnabled()
- public bool isTranslatorEnabled()
- public static int getMessageLength()
- public static void setMessageLength()
- protected string translateMessage()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
97+ | validate the format |
189+ | enhance the implosion |
Constants
Name | Value |
---|---|
NOT_STEP | 'dateStepNotStep' |
FORMAT_DEFAULT | |
INVALID | 'dateInvalid' |
INVALID_DATE | 'dateInvalidDate' |
FALSEFORMAT | 'dateFalseFormat' |
FORMAT_DEFAULT | 'Y-m-d' |
Members
protected
- $abstractOptions
- $baseValue
—
Zend\Validator\string|int|\DateTime
Optional base date value - $defaultTranslator
—
Zend\Validator\Translator\TranslatorInterface
Default translation object for all validate objects - $defaultTranslatorTextDomain
—
string
Default text domain to be used with translator - $format — string
- $messageLength
—
int
Limits the maximum returned length of an error message - $messageTemplates — array
- $messageTemplates
—
array
Validation failure message template definitions - $messageVariables — array
- $step
—
DateInterval
Date step interval (defaults to 1 day). - $timezone
—
DateTimeZone
Optional timezone to be used when the baseValue and validation values do not contain timezone info - $value
—
mixed
The value to be validated
Methods
protected
- convertString() — Supports formats with ISO week (W) definitions
public
- __construct() — Set default options for this instance
- getBaseValue() — Returns the base value from which the step should be computed
- getStep() — Returns the step date interval
- getTimezone() — Returns the timezone option
- isValid() — Returns true if a date is within a valid step
- setBaseValue() — Sets the base value from which the step should be computed
- setStep() — Sets the step date interval
- setTimezone() — Sets the timezone option
Inherited from Zend\Validator\Date
protected
- convertArray() — Implodes the array into a string and proxies to {@link convertString()}.
- convertInteger() — Attempts to convert an integer into a DateTime object
- convertString() — Attempts to convert a string into a DateTime object
- convertToDateTime() — Attempts to convert an int, string, or array to a DateTime object
public
- getFormat() — Returns the format option
- isValid() — Returns true if $value is a DateTime instance or can be converted into one.
- setFormat() — Sets the format option
Inherited from Zend\Validator\AbstractValidator
protected
- createMessage() — Constructs and returns a validation failure message with the given message key and value.
- error()
- getValue() — Returns the validation value
- setValue() — Sets the value to be validated and clears the messages and errors arrays
- translateMessage() — Translate a validation message
public
- __get() — Magic function returns the value of the requested property, if and only if it is the value or a message variable.
- __invoke() — Invoke as command
- getDefaultTranslator() — Get default translation object for all validate objects
- getDefaultTranslatorTextDomain() — Get default translation text domain for all validate objects
- getMessageLength() — Returns the maximum allowed message length
- getMessageTemplates() — Returns the message templates from the validator
- getMessageVariables() — Returns an array of the names of variables that are used in constructing validation failure messages
- getMessages() — Returns array of validation failure messages
- getOption() — Returns an option
- getOptions() — Returns all available options
- getTranslator() — Return translation object
- getTranslatorTextDomain() — Return the translation text domain
- hasDefaultTranslator() — Is there a default translation object set?
- hasTranslator() — Does this validator have its own specific translator?
- isTranslatorEnabled() — Is translation enabled?
- isValueObscured() — Retrieve flag indicating whether or not value should be obfuscated in messages
- setDefaultTranslator() — Set default translation object for all validate objects
- setDefaultTranslatorTextDomain() — Set default translation text domain for all validate objects
- setMessage() — Sets the validation failure message template for a particular key
- setMessageLength() — Sets the maximum allowed message length
- setMessages() — Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
- setOptions() — Sets one or multiple options
- setTranslator() — Set translation object
- setTranslatorEnabled() — Indicate whether or not translation should be enabled
- setTranslatorTextDomain() — Set translation text domain
- setValueObscured() — Set flag indicating whether or not value should be obfuscated in messages