public function setResponseFormat($format = 'json') { $this->responseFormat = in_array($format, array('json', 'xml')) ? $format : 'json'; }