Skip to content

Commit a621cef

Browse files
committed
Add missing methods
"Warning As of PHP 8.1.0, a class which implements Serializable without also implementing __serialize() and __unserialize() will generate a deprecation warning." https://www.php.net/manual/en/class.serializable.php
1 parent d183a63 commit a621cef

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Mvc/Collection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,4 +1516,14 @@ public function jsonSerialize(): array
15161516

15171517
return $data;
15181518
}
1519+
1520+
public function __serialize(): array
1521+
{
1522+
return $this->toArray();
1523+
}
1524+
1525+
public function __unserialize(array $data): void
1526+
{
1527+
$this->assign($data);
1528+
}
15191529
}

0 commit comments

Comments
 (0)