Propel API
Class

PropelDateTime

class PropelDateTime extends DateTime

DateTime subclass which supports serialization.

Currently Propel is not using this for storing date/time objects
within model objeects; however, we are keeping it in the repository
because it is useful if you want to store a DateTime object in a session.

Methods

static mixed newInstance(mixed $value, DateTimeZone $timeZone = null, string $dateTimeClass = 'DateTime')

Factory method to get a DateTime object from a temporal input

static  isTimestamp($value)

array __sleep()

PHP "magic" function called when object is serialized.

__wakeup()

PHP "magic" function called when object is restored from serialized state.

Details

at line 47
static public mixed newInstance(mixed $value, DateTimeZone $timeZone = null, string $dateTimeClass = 'DateTime')

Factory method to get a DateTime object from a temporal input

Parameters

mixed $value The value to convert (can be a string, a timestamp, or another DateTime)
DateTimeZone $timeZone (optional) timezone
string $dateTimeClass The class of the object to create, defaults to DateTime

Return Value

mixed null, or an instance of $dateTimeClass

at line 77
static public isTimestamp($value)

Parameters

$value

at line 102
public array __sleep()

PHP "magic" function called when object is serialized.

Sets an internal property with the date string and returns properties
of class that should be serialized.

Return Value

array string[]

at line 115
public __wakeup()

PHP "magic" function called when object is restored from serialized state.

Calls DateTime constructor with previously stored string value of date.