PHP Class eZ\Publish\Core\FieldType\DateAndTime\Value

Inheritance: extends eZ\Publish\Core\FieldType\Value
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Public Properties

Property Type Description
$stringFormat string Date format to be used by {@link __toString()}.
$value DateTime Date content.

Public Methods

Method Description
__construct ( DateTime $dateTime = null ) Construct a new Value object and initialize with $dateTime.
__toString ( )
fromString ( string $dateString ) : Value Creates a Value from the given $dateString.
fromTimestamp ( integer $timestamp ) : Value Creates a Value from the given $timestamp.

Method Details

__construct() public method

Construct a new Value object and initialize with $dateTime.
public __construct ( DateTime $dateTime = null )
$dateTime DateTime Date/Time as a DateTime object

__toString() public method

See also: eZ\Publish\Core\FieldType\Value
public __toString ( )

fromString() public static method

Creates a Value from the given $dateString.
public static fromString ( string $dateString ) : Value
$dateString string
return Value

fromTimestamp() public static method

Creates a Value from the given $timestamp.
public static fromTimestamp ( integer $timestamp ) : Value
$timestamp integer
return Value

Property Details

$stringFormat public property

Date format to be used by {@link __toString()}.
public string $stringFormat
return string

$value public property

Date content.
public DateTime $value
return DateTime