Esempio n. 1
0
 /**
  * @return mixed|void
  */
 protected function toJson()
 {
     $jsonCodec = new JsonCodec();
     return $jsonCodec->encode($this);
 }
Esempio n. 2
0
 /**
  * Encodes an object as a JSON string.
  *
  * @param $object
  *      the object to be represented as JSON encoded string.
  *
  * @return string
  *      a string containing the JSON representation of the object.
  */
 private static function jsonEncode($object)
 {
     return JsonCodec::encode($object);
 }