raw_data = $json_data; $temp = json_decode($this->raw_data, true); $this->ip_requested = ''; $this->ip_client = ''; $this->iso = ''; if(isset( $temp['ip_requested'])) $this->ip_requested = $temp['ip_requested']; if(isset( $temp['ip_client'])) $this->ip_client = $temp['ip_client']; if(isset( $temp['iso'])) $this->iso = $temp['iso']; } /** * @return mixed */ public function getIpRequested() { return $this->ip_requested; } /** * @return mixed */ public function getIpClient() { return $this->ip_client; } /** * @return mixed */ public function getIso() { return $this->iso; } /** * @return string */ public function getRawData(): string { return $this->raw_data; } public function __toString(){ return $this->raw_data; } }