public function DateObject::__sleep in Date 7.3
Same name and namespace in other branches
- 7 date_api/date_api.module \DateObject::__sleep()
- 7.2 date_api/date_api.module \DateObject::__sleep()
Prepares the object during serialization.
We are extending a core class and core classes cannot be serialized.
Return value
array Returns an array with the names of the variables that were serialized.
See also
File
- date_api/
date_api.module, line 184 - This module will make the date API available to other modules.
Class
- DateObject
- Extend PHP DateTime class.
Code
public function __sleep() {
$this->serializedTime = $this
->format('c');
$this->serializedTimezone = $this
->getTimezone()
->getName();
return array(
'serializedTime',
'serializedTimezone',
);
}