| 1 | <?php |
||
| 17 | class JsonBehavior extends Behavior |
||
| 18 | { |
||
| 19 | public $attributes = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @inheritdoc |
||
| 23 | */ |
||
| 24 | public function events() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Encode attributes. |
||
| 33 | */ |
||
| 34 | public function autoEncodeAttributes() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Encodes the given value into a JSON string. |
||
| 51 | * |
||
| 52 | * @param mixed $value This is commonly an array. |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function jsonEncode($value) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Decodes the given JSON string into a PHP data structure. |
||
| 62 | * |
||
| 63 | * @param string $value |
||
| 64 | * @return array |
||
| 65 | */ |
||
| 66 | public function jsonDecode($value) |
||
| 70 | } |