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 | use ColumnsProtectedMethods; |
||
| 8 | |||
| 9 | // ------------ |
||
| 10 | // COLUMNS |
||
| 11 | // ------------ |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Get the CRUD columns for the current operation. |
||
| 15 | * |
||
| 16 | * @return array CRUD columns. |
||
| 17 | */ |
||
| 18 | public function columns() |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Add a bunch of column names and their details to the CRUD object. |
||
| 25 | * |
||
| 26 | * @param array|string $columns |
||
| 27 | */ |
||
| 28 | public function setColumns($columns) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Add a column at the end of to the CRUD object's "columns" array. |
||
| 60 | * |
||
| 61 | * @param array|string $column |
||
| 62 | * |
||
| 63 | * @return self |
||
| 64 | */ |
||
| 65 | public function addColumn($column) |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Add multiple columns at the end of the CRUD object's "columns" array. |
||
| 76 | * |
||
| 77 | * @param array $columns |
||
| 78 | */ |
||
| 79 | public function addColumns($columns) |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Move the most recently added column after the given target column. |
||
| 90 | * |
||
| 91 | * @param string|array $targetColumn The target column name or array. |
||
| 92 | */ |
||
| 93 | public function afterColumn($targetColumn) |
||
| 97 | |||
| 98 | /** |
||
| 99 | * Move the most recently added column before the given target column. |
||
| 100 | * |
||
| 101 | * @param string|array $targetColumn The target column name or array. |
||
| 102 | */ |
||
| 103 | public function beforeColumn($targetColumn) |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Move this column to be first in the columns list. |
||
| 110 | * |
||
| 111 | * @return bool|null |
||
| 112 | */ |
||
| 113 | public function makeFirstColumn() |
||
| 122 | |||
| 123 | /** |
||
| 124 | * Add the default column type to the given Column, inferring the type from the database column type. |
||
| 125 | * |
||
| 126 | * @param array $column |
||
| 127 | * |
||
| 128 | * @return array|bool |
||
| 129 | */ |
||
| 130 | public function addDefaultTypeToColumn($column) |
||
| 140 | |||
| 141 | /** |
||
| 142 | * Remove a column from the CRUD panel by name. |
||
| 143 | * |
||
| 144 | * @param string $columnKey The column key. |
||
| 145 | */ |
||
| 146 | public function removeColumn($columnKey) |
||
| 152 | |||
| 153 | /** |
||
| 154 | * Remove multiple columns from the CRUD panel by name. |
||
| 155 | * |
||
| 156 | * @param array $columns Array of column names. |
||
| 157 | */ |
||
| 158 | public function removeColumns($columns) |
||
| 166 | |||
| 167 | /** |
||
| 168 | * Remove all columns from the CRUD panel. |
||
| 169 | */ |
||
| 170 | public function removeAllColumns() |
||
| 174 | |||
| 175 | /** |
||
| 176 | * Change attributes for multiple columns. |
||
| 177 | * |
||
| 178 | * @param array $columns |
||
| 179 | * @param array $attributes |
||
| 180 | */ |
||
| 181 | public function setColumnsDetails($columns, $attributes) |
||
| 187 | |||
| 188 | /** |
||
| 189 | * Change attributes for a certain column. |
||
| 190 | * |
||
| 191 | * @param string $columnKey Column key. |
||
| 192 | * @param array $attributesAndValues |
||
| 193 | */ |
||
| 194 | public function setColumnDetails($columnKey, $attributesAndValues) |
||
| 206 | |||
| 207 | /** |
||
| 208 | * Alias for setColumnDetails(). |
||
| 209 | * Provides a consistent syntax with Fields, Buttons, Filters modify functionality. |
||
| 210 | * |
||
| 211 | * @param string $column Column name. |
||
| 212 | * @param array $attributes |
||
| 213 | */ |
||
| 214 | public function modifyColumn($column, $attributes) |
||
| 218 | |||
| 219 | /** |
||
| 220 | * Set label for a specific column. |
||
| 221 | * |
||
| 222 | * @param string $column |
||
| 223 | * @param string $label |
||
| 224 | */ |
||
| 225 | public function setColumnLabel($column, $label) |
||
| 229 | |||
| 230 | /** |
||
| 231 | * Get the relationships used in the CRUD columns. |
||
| 232 | * |
||
| 233 | * @return array Relationship names |
||
| 234 | */ |
||
| 235 | public function getColumnsRelationships() |
||
| 243 | |||
| 244 | /** |
||
| 245 | * Order the CRUD columns. If certain columns are missing from the given order array, they will be pushed to the |
||
| 246 | * new columns array in the original order. |
||
| 247 | * |
||
| 248 | * @param array $order An array of column names in the desired order. |
||
| 249 | */ |
||
| 250 | public function orderColumns($order) |
||
| 266 | |||
| 267 | /** |
||
| 268 | * Get a column by the id, from the associative array. |
||
| 269 | * |
||
| 270 | * @param int $column_number Placement inside the columns array. |
||
| 271 | * |
||
| 272 | * @return array Column details. |
||
| 273 | */ |
||
| 274 | public function findColumnById($column_number) |
||
| 280 | |||
| 281 | /** |
||
| 282 | * Get the visibility priority for the actions column |
||
| 283 | * in the CRUD table view. |
||
| 284 | * |
||
| 285 | * @return int The priority, from 1 to infinity. Lower is better. |
||
| 286 | */ |
||
| 287 | public function getActionsColumnPriority() |
||
| 291 | |||
| 292 | /** |
||
| 293 | * Set a certain priority for the actions column |
||
| 294 | * in the CRUD table view. Usually set to 10000 in order to hide it. |
||
| 295 | * |
||
| 296 | * @param int $number The priority, from 1 to infinity. Lower is better. |
||
| 297 | * |
||
| 298 | * @return self |
||
| 299 | */ |
||
| 300 | public function setActionsColumnPriority($number) |
||
| 306 | } |
||
| 307 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.