@@ -39,7 +39,18 @@ public function __construct(array $data = array())
39
39
* @return array
40
40
*/
41
41
abstract protected function getDefinition ();
42
-
42
+
43
+ /**
44
+ * This method is called by var_dump() when dumping an object to get the properties that should be shown.
45
+ * If the method isn't defined on an object, then all public, protected and private properties will be shown.
46
+ * @return array
47
+ * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
48
+ */
49
+ public function __debugInfo ()
50
+ {
51
+ return $ this ->_storage ;
52
+ }
53
+
43
54
/**
44
55
* Whether a offset exists
45
56
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
@@ -65,6 +76,30 @@ public function offsetGet($offset)
65
76
throw $ this ->_createOutOfBoundsException ($ offset );
66
77
}
67
78
79
+ /**
80
+ * String representation of object
81
+ * @link http://php.net/manual/en/serializable.serialize.php
82
+ * @return string the string representation of the object or null
83
+ */
84
+ public function serialize ()
85
+ {
86
+ return serialize (array (
87
+ $ this ->_definition ,
88
+ $ this ->_storage
89
+ ));
90
+ }
91
+
92
+ /**
93
+ * Constructs the object
94
+ * @link http://php.net/manual/en/serializable.unserialize.php
95
+ * @param string $serialized The string representation of the object.
96
+ * @return void
97
+ */
98
+ public function unserialize ($ serialized )
99
+ {
100
+ list ($ this ->_definition , $ this ->_storage ) = unserialize ($ serialized );
101
+ }
102
+
68
103
/**
69
104
* Offset to set
70
105
* @link http://php.net/manual/en/arrayaccess.offsetset.php
0 commit comments