| 1 | <?php |
||
| 19 | trait IsSerializable |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Serialize collection data and return it. |
||
| 23 | * |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | public function serialize() |
||
| 27 | { |
||
| 28 | return serialize($this->toArray()); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Unserialize serialized data. |
||
| 33 | * |
||
| 34 | * @param string $serialized The serialized data |
||
| 35 | */ |
||
| 36 | abstract public function unserialize($serialized); |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return array |
||
| 40 | */ |
||
| 41 | abstract public function toArray(); |
||
| 42 | } |
||
| 43 |