1 | <?php |
||
11 | class EloquentDataTable extends QueryDataTable |
||
12 | { |
||
13 | /** |
||
14 | * @var \Illuminate\Database\Eloquent\Builder |
||
15 | */ |
||
16 | protected $query; |
||
17 | |||
18 | /** |
||
19 | * EloquentEngine constructor. |
||
20 | * |
||
21 | * @param mixed $model |
||
22 | */ |
||
23 | public function __construct($model) |
||
30 | |||
31 | /** |
||
32 | * If column name could not be resolved then use primary key. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | protected function getPrimaryKeyName() |
||
40 | |||
41 | /** |
||
42 | * Compile query builder where clause depending on configurations. |
||
43 | * |
||
44 | * @param mixed $query |
||
45 | * @param string $columnName |
||
46 | * @param string $keyword |
||
47 | * @param string $boolean |
||
48 | */ |
||
49 | protected function compileQuerySearch($query, $columnName, $keyword, $boolean = 'or') |
||
68 | |||
69 | /** |
||
70 | * Resolve the proper column name be used. |
||
71 | * |
||
72 | * @param string $column |
||
73 | * @return string |
||
74 | */ |
||
75 | protected function resolveRelationColumn($column) |
||
91 | |||
92 | /** |
||
93 | * Get eager loads keys if eloquent. |
||
94 | * |
||
95 | * @return array |
||
96 | */ |
||
97 | protected function getEagerLoads() |
||
101 | |||
102 | /** |
||
103 | * Join eager loaded relation and get the related column name. |
||
104 | * |
||
105 | * @param string $relation |
||
106 | * @param string $relationColumn |
||
107 | * @return string |
||
108 | * @throws \Yajra\DataTables\Exceptions\Exception |
||
109 | */ |
||
110 | protected function joinEagerLoadedColumn($relation, $relationColumn) |
||
155 | |||
156 | /** |
||
157 | * Perform join query. |
||
158 | * |
||
159 | * @param string $table |
||
160 | * @param string $foreign |
||
161 | * @param string $other |
||
162 | * @param string $type |
||
163 | */ |
||
164 | protected function performJoin($table, $foreign, $other, $type = 'left') |
||
175 | } |
||
176 |