_code = 200; $this->_type = 'text/html'; $this->_data = []; } public function setCode($code) { $this->_code = $code; } public function getCode() { return $this->_code; } public function setType($type) { $this->_type = $type; } public function getType() { return $this->_type; } public function setData($data) { $this->_data = $data; } public function getData() { return $this->_data; } public function setError($text) { if ($this->_type != 'application/json') throw new Exception('Kein Backend Call'); $this->setData(['status' => false, 'error' => $text]); } public function setLocation($url) { $this->_location = $url; } public function getLocation() { return $this->_location; } }