We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
5 | trait Columns |
||
6 | { |
||
7 | // ------------ |
||
8 | // COLUMNS |
||
9 | // ------------ |
||
10 | |||
11 | /** |
||
12 | * Add a bunch of column names and their details to the CRUD object. |
||
13 | * |
||
14 | * @param [array or multi-dimensional array] |
||
15 | */ |
||
16 | public function setColumns($columns) |
||
48 | |||
49 | /** |
||
50 | * Add a column at the end of to the CRUD object's "columns" array. |
||
51 | * |
||
52 | * @param [string or array] |
||
53 | */ |
||
54 | public function addColumn($column) |
||
79 | |||
80 | /** |
||
81 | * Add multiple columns at the end of the CRUD object's "columns" array. |
||
82 | * |
||
83 | * @param [array of columns] |
||
84 | */ |
||
85 | public function addColumns($columns) |
||
93 | |||
94 | /** |
||
95 | * Move the most recently added column after the given target column. |
||
96 | * |
||
97 | * @param string|array $targetColumn The target column name or array. |
||
98 | */ |
||
99 | public function afterColumn($targetColumn) |
||
103 | |||
104 | /** |
||
105 | * Move the most recently added column before the given target column. |
||
106 | * |
||
107 | * @param string|array $targetColumn The target column name or array. |
||
108 | */ |
||
109 | public function beforeColumn($targetColumn) |
||
113 | |||
114 | /** |
||
115 | * Move the most recently added column before or after the given target column. Default is before. |
||
116 | * |
||
117 | * @param string|array $targetColumn The target column name or array. |
||
118 | * @param bool $before If true, the column will be moved before the target column, otherwise it will be moved after it. |
||
119 | */ |
||
120 | private function moveColumn($targetColumn, $before = true) |
||
137 | |||
138 | /** |
||
139 | * Add the default column type to the given Column, inferring the type from the database column type. |
||
140 | * |
||
141 | * @param [column array] |
||
142 | */ |
||
143 | public function addDefaultTypeToColumn($column) |
||
153 | |||
154 | /** |
||
155 | * If a field or column array is missing the "label" attribute, an ugly error would be show. |
||
156 | * So we add the field Name as a label - it's better than nothing. |
||
157 | * |
||
158 | * @param [field or column] |
||
159 | */ |
||
160 | public function addDefaultLabel($array) |
||
170 | |||
171 | /** |
||
172 | * Remove a column from the CRUD panel by name. |
||
173 | * |
||
174 | * @param string $column The column name. |
||
175 | */ |
||
176 | public function removeColumn($column) |
||
180 | |||
181 | /** |
||
182 | * Remove multiple columns from the CRUD panel by name. |
||
183 | * |
||
184 | * @param array $columns Array of column names. |
||
185 | */ |
||
186 | public function removeColumns($columns) |
||
194 | |||
195 | /** |
||
196 | * Remove an entry from an array. |
||
197 | * |
||
198 | * @param string $entity |
||
199 | * @param array $fields |
||
200 | * @return array values |
||
201 | * |
||
202 | * @deprecated This method is no longer used by internal code and is not recommended as it does not preserve the |
||
203 | * target array keys. |
||
204 | * @see Columns::removeColumn() to remove a column from the CRUD panel by name. |
||
205 | * @see Columns::removeColumns() to remove multiple columns from the CRUD panel by name. |
||
206 | */ |
||
207 | public function remove($entity, $fields) |
||
213 | |||
214 | /** |
||
215 | * Change attributes for multiple columns. |
||
216 | * |
||
217 | * @param [columns arrays] |
||
218 | * @param [attributes and values array] |
||
219 | */ |
||
220 | public function setColumnsDetails($columns, $attributes) |
||
224 | |||
225 | /** |
||
226 | * Change attributes for a certain column. |
||
227 | * |
||
228 | * @param [string] Column name. |
||
229 | * @param [attributes and values array] |
||
230 | */ |
||
231 | public function setColumnDetails($column, $attributes) |
||
235 | |||
236 | /** |
||
237 | * Order the columns in a certain way. |
||
238 | * |
||
239 | * @param [string] Column name. |
||
240 | * @param [attributes and values array] |
||
241 | */ |
||
242 | public function setColumnOrder($columns) |
||
246 | |||
247 | // ALIAS of setColumnOrder($columns) |
||
248 | public function setColumnsOrder($columns) |
||
252 | |||
253 | /** |
||
254 | * Get the relationships used in the CRUD columns. |
||
255 | * @return [array] Relationship names |
||
256 | */ |
||
257 | public function getColumnsRelationships() |
||
265 | |||
266 | // ------------ |
||
267 | // TONE FUNCTIONS - UNDOCUMENTED, UNTESTED, SOME MAY BE USED |
||
268 | // ------------ |
||
269 | // TODO: check them |
||
270 | |||
271 | public function getColumns() |
||
275 | |||
276 | public function orderColumns($order) |
||
280 | } |
||
281 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: