Passed
Push — master ( f652cc...414045 )
by Radu
01:16
created

AbstractDataTables::getResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace WebServCo\Framework\DataTables;
3
4
abstract class AbstractDataTables implements \WebServCo\Framework\Interfaces\DataTablesInterface
5
{
6
    abstract protected function getData(Request $request);
7
    abstract protected function getRecordsFiltered();
8
    abstract protected function getRecordsTotal();
9
10
    public function getResponse(Request $request)
11
    {
12
        return new Response(
13
            $request->getDraw(),
14
            $this->getRecordsTotal(),
15
            $this->getRecordsFiltered(),
16
            $this->getData($request)
17
        );
18
    }
19
}
20