allow filtering and altering output before it is sent

This commit is contained in:
Guillermo Dev
2019-02-09 06:38:37 +01:00
parent 941b47eb06
commit e65b4d1bd3

View File

@@ -38,6 +38,7 @@ abstract class WebService
$result = $this->call($sendSession);
$data["result"][$this->func] = $result;
$data = $this->filterOutput($data);
} catch (WebException $e) {
@@ -152,9 +153,21 @@ abstract class WebService
/**
* Allow subclasses to filter params by overriding this
* @param $params
* @param array
*/
protected function filterParams($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;
}
}