/** * Return the current object in a application/hal+json format (links and * resources). * * @param bool $pretty * Enable pretty-printing. * @return string */ public function asJson($pretty = false) { $renderer = new HalJsonRenderer(); return $renderer->render($this, $pretty); }
/** * Return the current object in a application/hal+json format (links and * resources). * * @param bool $pretty * Enable pretty-printing. * @param bool $encode * Run through json_encode * @return string */ public function asJson($pretty = false, $encode = true) { $renderer = new HalJsonRenderer(); return $renderer->render($this, $pretty, $encode); }