/**
  * Get encoded json string of current JsonObject state
  *
  * @link  http://php.net/manual/en/function.json-encode.php
  * @link  http://www.php.net/manual/en/json.constants.php
  *
  * @param   int $options  json_encode options
  * @throws \Exception
  * @return  string
  */
 public function getEncoded($options = 0)
 {
     if (!is_int($options)) {
         throw new \Exception('Cannot pass non-int value to getJSON');
     }
     return json_encode($this->json->jsonSerialize(), $options);
 }