Date
extends DataType
in package
A Date Value
Table of Contents
- $validators : array<string|int, callable>
- $value : mixed
- __construct() : mixed
- The constructor is normally called from the DataObject when instatiated.
- __get() : mixed
- __toString() : string
- Make sure to overwrite this method in the implementations
- equals() : mixed
- Compares the internal value with the $compare argument
- in() : mixed
- Stores the $value as a DateTime Object
- out() : mixed
- Returns the $value applying the output filters
- raw() : mixed
- Returns the value without processing it
- validate() : true
- Runs all registered validators
- value() : mixed
- Returns the internal value
Properties
$validators
protected
array<string|int, callable>
$validators
= []
An array of functions that are executed on validation
$value
protected
mixed
$value
The internal value of the DataType
Methods
__construct()
The constructor is normally called from the DataObject when instatiated.
public
__construct([mixed $value = null ][, mixed $props = [] ]) : mixed
Parameters
- $value : mixed = null
- $props : mixed = []
-
The properties for the standard validators
Return values
mixed —__get()
public
__get(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —__toString()
Make sure to overwrite this method in the implementations
public
__toString() : string
Return values
string —The string representation of the DataType
equals()
Compares the internal value with the $compare argument
public
equals(DataType|mixed $compare) : mixed
Remember that you get a DataObject when using the DataObjects values, thus comparison can have
undesired results, use the equals method to compare DataTypes
This has to be overwritten in the descendants to get the desired comparison behaviour
Parameters
- $compare : DataType|mixed
-
The value to be compared
Return values
mixed —in()
Stores the $value as a DateTime Object
public
in(mixed $value) : mixed
Parameters
- $value : mixed
Return values
mixed —out()
Returns the $value applying the output filters
public
out() : mixed
This method should be overwritten in the concrete implementation
Tags
Return values
mixed —raw()
Returns the value without processing it
public
raw() : mixed
Tags
Return values
mixed —validate()
Runs all registered validators
public
validate() : true
Tags
Return values
true —if validations was succsessful
value()
Returns the internal value
public
value() : mixed