code: public function jsonSerialize()
      {
          $json = [];
  
          if (null !== $this->limit) {
              $json['limit'] = $this->limit;
          }
          if (null !== $this->offset) {
              $json['offset'] = $this->offset;
          }
          if (null !== $this->timeSearching) {
              $json['timeSearching'] = $this->timeSearching;
          }
          if (null !== $this->totalHits) {
              $json['totalHits'] = $this->totalHits;
          }
  
          if (null !== $this->results && !empty($this->results)) {
              $json['results'] = $this->results;
          }
  
          return $json;
      }
docs: Gets all data that should be available in a json representation.
  
  @return array an associative array of the available variables