This repository was archived by the owner on Feb 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 234
Expand file tree
/
Copy pathColumnInterface.php
More file actions
124 lines (106 loc) · 2.78 KB
/
ColumnInterface.php
File metadata and controls
124 lines (106 loc) · 2.78 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/*
* This file is part of the SgDatatablesBundle package.
*
* (c) stwe <https://github.com/stwe/DatatablesBundle>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sg\DatatablesBundle\Datatable\Column;
/**
* Interface ColumnInterface.
*/
interface ColumnInterface
{
/**
* @var int
*/
const LAST_POSITION = -1;
/**
* Validates $dql. Normally a non-empty string is expected.
*
* @return bool
*/
public function dqlConstraint($dql);
/**
* Specifies whether only a single column of this type is allowed (example: MultiselectColumn).
*
* @return bool
*/
public function isUnique();
/**
* Checks whether an association is given.
*
* @return bool
*/
public function isAssociation();
/**
* Checks whether a toMany association is given.
*
* @return bool
*/
public function isToManyAssociation();
/**
* Use the column data value in SELECT statement.
* Normally is it true. In case of virtual Column, multi select column or data is null is it false.
*
* @return bool
*/
public function isSelectColumn();
public function getOptions(): array;
/**
* Sometimes it is necessary to add some special data to the output array.
* For example, the visibility of actions.
*
* @return $this
*/
public function addDataToOutputArray(array &$row);
/**
* Render images or any other special content.
* This function works similar to the DataTables Plugin 'columns.render'.
*/
public function renderCellContent(array &$row);
/**
* Render single field.
*
* @return $this
*/
public function renderSingleField(array &$row);
/**
* Render toMany.
*
* @return $this
*/
public function renderToMany(array &$row);
/**
* Get the template for the 'renderCellContent' function.
*
* @return string
*/
public function getCellContentTemplate();
/**
* Implementation of the 'Draw Event' - fired once the table has completed a draw.
* With this function can javascript execute after drawing the whole table.
* Used - for example - for the Editable function.
*/
public function renderPostCreateDatatableJsContent();
/**
* The allowed Column positions as array.
*
* @return array|null
*/
public function allowedPositions();
/**
* Returns the Column type.
*
* @return string
*/
public function getColumnType();
/**
* Does special content need to be rendered for editable?
*
* @return bool
*/
public function isEditableContentRequired(array $row);
}