Esempio n. 1
0
 /**
  * Deserializes from JSON, validating the errors (will return an associative array
  * instead of objects)
  *
  * @param string $json
  * @return mixed
  */
 public function fromJSON($json)
 {
     JSON::$useBuiltinEncoderDecoder = true;
     return JSON::decode($json);
 }
Esempio n. 2
0
 /**
  * Serialize to JSON, validating the errors
  *
  * @param mixed $data
  * @return string
  */
 public function toJSON($data)
 {
     JSON::$useBuiltinEncoderDecoder = true;
     return JSON::encode($data);
 }