1 | <?php |
||
14 | trait HasColumns |
||
15 | { |
||
16 | /** |
||
17 | * Set columnDefs option value. |
||
18 | * |
||
19 | * @param array $value |
||
20 | * @return $this |
||
21 | * @see https://datatables.net/reference/option/columnDefs |
||
22 | */ |
||
23 | public function columnDefs(array $value) |
||
29 | |||
30 | /** |
||
31 | * Set columns option value. |
||
32 | * |
||
33 | * @param array $columns |
||
34 | * @return $this |
||
35 | * @see https://datatables.net/reference/option/columns |
||
36 | */ |
||
37 | public function columns(array $columns) |
||
67 | |||
68 | /** |
||
69 | * Set title attribute of an array if not set. |
||
70 | * |
||
71 | * @param string $title |
||
72 | * @param array $attributes |
||
73 | * @return array |
||
74 | */ |
||
75 | public function setTitle($title, array $attributes) |
||
83 | |||
84 | /** |
||
85 | * Convert string into a readable title. |
||
86 | * |
||
87 | * @param string $title |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getQualifiedTitle($title) |
||
94 | |||
95 | /** |
||
96 | * Add a column in collection usingsl attributes. |
||
97 | * |
||
98 | * @param array $attributes |
||
99 | * @return $this |
||
100 | */ |
||
101 | public function addColumn(array $attributes) |
||
107 | |||
108 | /** |
||
109 | * Add a Column object at the beginning of collection. |
||
110 | * |
||
111 | * @param \Yajra\DataTables\Html\Column $column |
||
112 | * @return $this |
||
113 | */ |
||
114 | public function addBefore(Column $column) |
||
120 | |||
121 | /** |
||
122 | * Add a column at the beginning of collection using attributes. |
||
123 | * |
||
124 | * @param array $attributes |
||
125 | * @return $this |
||
126 | */ |
||
127 | public function addColumnBefore(array $attributes) |
||
133 | |||
134 | /** |
||
135 | * Add a Column object in collection. |
||
136 | * |
||
137 | * @param \Yajra\DataTables\Html\Column $column |
||
138 | * @return $this |
||
139 | */ |
||
140 | public function add(Column $column) |
||
146 | |||
147 | /** |
||
148 | * Get collection of columns. |
||
149 | * |
||
150 | * @return \Illuminate\Support\Collection |
||
151 | */ |
||
152 | public function getColumns() |
||
156 | |||
157 | /** |
||
158 | * Remove column by name. |
||
159 | * |
||
160 | * @param array $names |
||
161 | * @return $this |
||
162 | */ |
||
163 | public function removeColumn(...$names) |
||
173 | } |
||
174 |
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: