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) |
||
69 | |||
70 | /** |
||
71 | * Add multiple columns at the end of the CRUD object's "columns" array. |
||
72 | * |
||
73 | * @param [array of columns] |
||
74 | */ |
||
75 | public function addColumns($columns) |
||
83 | |||
84 | /** |
||
85 | * Add the default column type to the given Column, inferring the type from the database column type. |
||
86 | * |
||
87 | * @param [column array] |
||
88 | */ |
||
89 | public function addDefaultTypeToColumn($column) |
||
99 | |||
100 | /** |
||
101 | * If a field or column array is missing the "label" attribute, an ugly error would be show. |
||
102 | * So we add the field Name as a label - it's better than nothing. |
||
103 | * |
||
104 | * @param [field or column] |
||
105 | */ |
||
106 | public function addDefaultLabel($array) |
||
116 | |||
117 | /** |
||
118 | * Remove multiple columns from the CRUD object using their names. |
||
119 | * |
||
120 | * @param [column array] |
||
121 | */ |
||
122 | public function removeColumns($columns) |
||
126 | |||
127 | /** |
||
128 | * Remove a column from the CRUD object using its name. |
||
129 | * |
||
130 | * @param [column array] |
||
131 | */ |
||
132 | public function removeColumn($column) |
||
136 | |||
137 | /** |
||
138 | * @param string $entity |
||
139 | */ |
||
140 | public function remove($entity, $fields) |
||
146 | |||
147 | /** |
||
148 | * Change attributes for multiple columns. |
||
149 | * |
||
150 | * @param [columns arrays] |
||
151 | * @param [attributes and values array] |
||
152 | */ |
||
153 | public function setColumnsDetails($columns, $attributes) |
||
157 | |||
158 | /** |
||
159 | * Change attributes for a certain column. |
||
160 | * |
||
161 | * @param [string] Column name. |
||
162 | * @param [attributes and values array] |
||
163 | */ |
||
164 | public function setColumnDetails($column, $attributes) |
||
168 | |||
169 | /** |
||
170 | * Order the columns in a certain way. |
||
171 | * |
||
172 | * @param [string] Column name. |
||
173 | * @param [attributes and values array] |
||
174 | */ |
||
175 | public function setColumnOrder($columns) |
||
179 | |||
180 | // ALIAS of setColumnOrder($columns) |
||
181 | public function setColumnsOrder($columns) |
||
185 | |||
186 | /** |
||
187 | * Get the relationships used in the CRUD columns. |
||
188 | * @return [array] Relationship names |
||
189 | */ |
||
190 | public function getColumnsRelationships() |
||
198 | |||
199 | // ------------ |
||
200 | // TONE FUNCTIONS - UNDOCUMENTED, UNTESTED, SOME MAY BE USED |
||
201 | // ------------ |
||
202 | // TODO: check them |
||
203 | |||
204 | public function getColumns() |
||
208 | |||
209 | public function orderColumns($order) |
||
213 | } |
||
214 |
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: