hideAttrs)->push("hideAttrs")->toArray(); foreach ($this as $key => $val) { if (!in_array($key, $hide) && $val !== null) { $data[$key] = $val; } } return $data; } public function __toString(): string { // TODO: Implement __toString() method. return json_encode($this->jsonSerialize(), JSON_UNESCAPED_UNICODE); } }