allow filtering and altering output before it is sent

master
Guillermo Dev 7 years ago
parent 941b47eb06
commit e65b4d1bd3

@ -38,6 +38,7 @@ abstract class WebService
$result = $this->call($sendSession); $result = $this->call($sendSession);
$data["result"][$this->func] = $result; $data["result"][$this->func] = $result;
$data = $this->filterOutput($data);
} catch (WebException $e) { } catch (WebException $e) {
@ -152,9 +153,21 @@ abstract class WebService
/** /**
* Allow subclasses to filter params by overriding this * Allow subclasses to filter params by overriding this
* @param $params * @param $params
* @param array
*/ */
protected function filterParams($params) protected function filterParams($params)
{ {
return $params; return $params;
} }
/**
* Allow subclasses to filter the output before it is sent
* by overriding this method
* @param $params
* @return array
*/
protected function filterOutput(array $data)
{
return $data;
}
} }

Loading…
Cancel
Save