1 | <?php |
||
9 | class DataTables |
||
10 | { |
||
11 | /** |
||
12 | * DataTables request object. |
||
13 | * |
||
14 | * @var \Yajra\DataTables\Utilities\Request |
||
15 | */ |
||
16 | protected $request; |
||
17 | |||
18 | /** |
||
19 | * HTML builder instance. |
||
20 | * |
||
21 | * @var \Yajra\DataTables\Html\Builder |
||
22 | */ |
||
23 | protected $html; |
||
24 | |||
25 | /** |
||
26 | * Make a DataTable instance from source. |
||
27 | * Alias of make for backward compatibility. |
||
28 | * |
||
29 | * @param mixed $source |
||
30 | * @return mixed |
||
31 | * @throws \Exception |
||
32 | */ |
||
33 | public function of($source) |
||
37 | |||
38 | /** |
||
39 | * Make a DataTable instance from source. |
||
40 | * |
||
41 | * @param mixed $source |
||
42 | * @return mixed |
||
43 | * @throws \Exception |
||
44 | */ |
||
45 | public function make($source) |
||
57 | |||
58 | /** |
||
59 | * Check whether a variable is the given type. |
||
60 | * |
||
61 | * @param mixed $var |
||
62 | * @param string $type |
||
63 | * @return bool |
||
64 | */ |
||
65 | protected function checkType($var, $type) |
||
77 | |||
78 | /** |
||
79 | * Create a new DataTable instance. |
||
80 | * |
||
81 | * @param string $engine |
||
82 | * @param mixed $source |
||
83 | * @return mixed |
||
84 | * @throws \Exception |
||
85 | */ |
||
86 | protected function createDataTable($engine, $source) |
||
96 | |||
97 | /** |
||
98 | * Get request object. |
||
99 | * |
||
100 | * @return \Yajra\DataTables\Utilities\Request |
||
101 | */ |
||
102 | public function getRequest() |
||
106 | |||
107 | /** |
||
108 | * Get config instance. |
||
109 | * |
||
110 | * @return \Yajra\DataTables\Utilities\Config |
||
111 | */ |
||
112 | public function getConfig() |
||
116 | |||
117 | /** |
||
118 | * @deprecated Please use query() instead, this method will be removed in a next version. |
||
119 | * @param $builder |
||
120 | * @return QueryDataTable |
||
121 | */ |
||
122 | public function queryBuilder($builder) |
||
126 | |||
127 | /** |
||
128 | * Get html builder instance. |
||
129 | * |
||
130 | * @return \Yajra\DataTables\Html\Builder |
||
131 | * @throws \Exception |
||
132 | */ |
||
133 | public function getHtmlBuilder() |
||
141 | |||
142 | /** |
||
143 | * Make a DataTable instance by using method name as engine. |
||
144 | * |
||
145 | * @param string $method |
||
146 | * @param array $parameters |
||
147 | * @return mixed |
||
148 | */ |
||
149 | public function __call($method, $parameters) |
||
153 | } |
||
154 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: