protected function createJsonResponse($service, $properties, $config)
{
// init service properties
foreach ($properties as $name => $value) {
$service->setSubproperty($name, $value);
}
$service->init($config);
//send content if not null
if (($content = $service->getJsonContent()) !== null) {
$response = $this->getResponse();
$response->setContentType('application/json');
$response->setCharset('UTF-8');
//send content
$response->write(TJavaScript::jsonEncode($content));
}
}