This repository has been archived by the owner on Mar 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDriver.php
100 lines (88 loc) · 1.91 KB
/
Driver.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
namespace Solire\Trieur;
use Solire\Conf\Conf;
/**
* Datatables driver.
*
* @author thansen <thansen@solire.fr>
* @license MIT http://mit-license.org/
*/
abstract class Driver
{
/**
* The configuration.
*
* @var Config
*/
protected $config;
/**
* The columns configuration.
*
* @var Columns
*/
protected $columns;
/**
* The request.
*
* @var array
*/
protected $request;
/**
* Constructeur.
*
* @param Conf $config The driver configuration
* @param Conf $columns The columns configuration
*/
public function __construct(Conf $config, Columns $columns)
{
$this->config = $config;
$this->columns = $columns;
}
/**
* Set the request.
*
* @param mixed $request The request
*
* @return void
*/
public function setRequest($request)
{
$this->request = $request;
}
/**
* Return the offset.
*
* @return int
*/
abstract public function getOffset();
/**
* Return the number of lines.
*
* @return int
*/
abstract public function getLength();
/**
* Return the order.
*
* @return mixed
*/
abstract public function getOrder();
/**
* Return the filters.
*
* @return mixed
*/
abstract public function getFilters();
/**
* Returns the response.
*
* @param array $data The data filtered by the current filters,
* offset and length, sorted by the current orders
* @param int $count The total of available lines filtered by the
* current filters
* @param int $filteredCount The total of available lines
*
* @return array
*/
abstract public function getResponse(array $data, $count = null, $filteredCount = null);
}