private function toJson($object, $view = null)
    {
        return json_encode($this->builder->buildRepresentation($object, $view));
    }
private function toJson($object, $view = null)
    {
        return json_encode($this->builder->buildRepresentation($object, $view));
    }
private function toJson ( $ object , $ view = null ) { return json_encode ( $ this -> builder -> buildRepresentation ( $ object , $ view ) ) ; }
Handles serializing an object to json

@param      $object
@param null $view
@return string
Handles serializing an object to json