public function getAction($id)
{
$response = new Response();
$usersId = $this->session->get('identity');
if (!$usersId) {
$response->setStatusCode(401, 'Unauthorized');
return $response;
}
$parametersReply = ['id = ?0', 'bind' => [$id]];
$postReply = PostsReplies::findFirst($parametersReply);
if ($postReply) {
$data = ['status' => 'OK', 'id' => $postReply->id, 'comment' => $postReply->content];
} else {
$data = ['status' => 'ERROR'];
}
$response->setJsonContent($data);
return $response;
}