aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/StudipArrayObject.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/classes/StudipArrayObject.class.php')
-rw-r--r--lib/classes/StudipArrayObject.class.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/classes/StudipArrayObject.class.php b/lib/classes/StudipArrayObject.class.php
index 531da67..da7e66e 100644
--- a/lib/classes/StudipArrayObject.class.php
+++ b/lib/classes/StudipArrayObject.class.php
@@ -135,6 +135,38 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
}
/**
+ * Called when serializing an ArrayObject
+ */
+ public function __serialize(): array
+ {
+ return get_object_vars($this);
+ }
+
+ /**
+ * Called when unserializing an ArrayObject
+ */
+ public function __unserialize(array $data): void
+ {
+ foreach ($data as $k => $v) {
+ switch ($k) {
+ case 'flag':
+ $this->setFlags($v);
+ break;
+ case 'storage':
+ $this->exchangeArray($v);
+ break;
+ case 'iteratorClass':
+ $this->setIteratorClass($v);
+ break;
+ case 'protectedProperties':
+ break;
+ default:
+ $this->__set($k, $v);
+ }
+ }
+ }
+
+ /**
* Appends the value
*
* @param mixed $value