| 1 | <?php namespace Arcanedev\GeoLocation\Traits; |
||
| 9 | trait CanBeJsonable |
||
| 10 | { |
||
| 11 | /* ----------------------------------------------------------------- |
||
| 12 | | Main Methods |
||
| 13 | | ----------------------------------------------------------------- |
||
| 14 | */ |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Convert the object to its JSON representation. |
||
| 18 | * |
||
| 19 | * @param int $options |
||
| 20 | * |
||
| 21 | * @return string |
||
| 22 | */ |
||
| 23 | 21 | public function toJson($options = 0) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Convert the object into something JSON serializable. |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | 21 | public function jsonSerialize() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Get the instance as an array. |
||
| 40 | * |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | abstract public function toArray(); |
||
| 44 | } |
||
| 45 |