From a8e9c7afab094884afeded5448a32b6635dc0a26 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 1 Feb 2016 21:04:58 +0100 Subject: [PATCH] Make serializable --- Datatypes/Location.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Datatypes/Location.php b/Datatypes/Location.php index ae392fcd5..b6a3f52e6 100644 --- a/Datatypes/Location.php +++ b/Datatypes/Location.php @@ -28,7 +28,7 @@ use phpOMS\Contract\JsonableInterface; * @link http://orange-management.com * @since 1.0.0 */ -class Location implements JsonableInterface +class Location implements JsonableInterface, \Serializable { /** @@ -256,4 +256,27 @@ class Location implements JsonableInterface return json_encode($this->toArray()); } + /** + * String representation of object + * @link http://php.net/manual/en/serializable.serialize.php + * @return string the string representation of the object or null + * @since 5.1.0 + */ + public function serialize() + { + return $this->toJson(); + } + + /** + * Constructs the object + * @link http://php.net/manual/en/serializable.unserialize.php + * @param string $serialized

+ * The string representation of the object. + *

+ * @return void + * @since 5.1.0 + */ + public function unserialize($serialized) + { + } }