public createResponse ( |
||
$data | The processed data. | |
$queryConfiguration | OpenSkill\Datatable\Queries\QueryConfiguration | the query configuration for the current request. |
$columnConfigurations | array | the column configurations for the current data table. |
return | Symfony\Component\HttpFoundation\JsonResponse | the response that should be returned to the client. |
public function createResponse(ResponseData $data, QueryConfiguration $queryConfiguration, array $columnConfigurations)
{
$responseData = ['draw' => $queryConfiguration->drawCall(), 'recordsTotal' => $data->totalDataCount(), 'recordsFiltered' => $data->filteredDataCount(), 'data' => $data->data()->toArray()];
return new JsonResponse($responseData);
}
public function testParse() { $cc = $this->version->parseRequest([]); $this->assertNotNull($cc); $rsp = $this->version->createResponse(new ResponseData(new Collection([]), 123), $cc, []); $this->assertNotNull($rsp); }