/**
  * Return the json formatted string based on decorator settings
  * @return mixed|string
  */
 public function getResult()
 {
     $json = $this->object->toJsonEncodeable();
     if (!$this->showEmpty) {
         $json = $this->removeEmpty($json);
     }
     if (!$this->showType) {
         $json = $this->removeType($json);
     }
     if ($this->dataGroup) {
         $output = new \stdClass();
         $group = $this->dataGroup;
         if (!empty($this->extraInfo) && is_array($this->extraInfo)) {
             foreach ($this->extraInfo as $key => $value) {
                 if ($key === $group) {
                     continue;
                 }
                 $output->{$key} = $value;
             }
         }
         $output->{$group} = $json;
     } else {
         if (!empty($this->extraInfo) && is_array($this->extraInfo)) {
             $output = new \stdClass();
             foreach ($this->extraInfo as $key => $value) {
                 if ($key === "body") {
                     continue;
                 }
                 $output->{$key} = $value;
             }
             $output->body = $json;
         } else {
             $output = $json;
         }
     }
     return json_encode($output, $this->jsonOptions);
 }