1 | <?php |
||
5 | class FakeObject extends ArrayObject { |
||
6 | public $dateTimeService; |
||
7 | |||
8 | function __construct($data = null, $flags = ArrayObject::ARRAY_AS_PROPS, $iteratorClass = 'ArrayIterator') { |
||
18 | |||
19 | public function getDefaults() { |
||
22 | |||
23 | /** |
||
24 | * Serialize object and contained objects an array, |
||
25 | * in a format with "_type" hints, useful for later restoring |
||
26 | * through {@link create_from_array()}. |
||
27 | * |
||
28 | * @see http://stackoverflow.com/questions/6836592/serializing-php-object-to-json |
||
29 | * @return Array |
||
30 | */ |
||
31 | public function toArray() { |
||
41 | |||
42 | /** |
||
43 | * Create nested object representation from array, |
||
44 | * based on "_type" hints. |
||
45 | * |
||
46 | * @param Array |
||
47 | * @return FakeObject |
||
48 | */ |
||
49 | public static function create_from_array($array) { |
||
71 | |||
72 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.