We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 248d60e commit a339ef7Copy full SHA for a339ef7
lib/Mongo/MongoId.php
@@ -142,6 +142,22 @@ public function unserialize($serialized)
142
$this->createObjectID($serialized);
143
}
144
145
+ /**
146
+ * @return string
147
+ */
148
+ public function __serialize()
149
+ {
150
+ return (string) $this->objectID;
151
+ }
152
+
153
154
+ * @param string $serialized
155
156
+ public function __unserialize($serialized)
157
158
+ $this->createObjectID($serialized);
159
160
161
/**
162
* Gets the incremented value to create this id
163
* @link http://php.net/manual/en/mongoid.getinc.php
0 commit comments