You are here

public function FeedsDateTime::__sleep in Feeds 7

Same name and namespace in other branches
  1. 6 plugins/FeedsParser.inc \FeedsDateTime::__sleep()
  2. 7.2 plugins/FeedsParser.inc \FeedsDateTime::__sleep()

Helper function to prepare the object during serialization.

We are extending a core class and core classes cannot be serialized.

Ref: http://bugs.php.net/41334, http://bugs.php.net/39821

File

plugins/FeedsParser.inc, line 457

Class

FeedsDateTime
Extend PHP DateTime class with granularity handling, merge functionality and slightly more flexible initialization parameters.

Code

public function __sleep() {
  $this->_serialized_time = $this
    ->format('c');
  $this->_serialized_timezone = $this
    ->getTimezone()
    ->getName();
  return array(
    '_serialized_time',
    '_serialized_timezone',
  );
}