| 1 | <?php |
||
| 7 | trait HasEditor |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Collection of Editors. |
||
| 11 | * |
||
| 12 | * @var null|Editor |
||
| 13 | */ |
||
| 14 | protected $editors = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Attach multiple editors to builder. |
||
| 18 | * |
||
| 19 | * @param mixed ...$editors |
||
| 20 | * @return $this |
||
| 21 | * @see https://editor.datatables.net/ |
||
| 22 | * @throws \Exception |
||
| 23 | */ |
||
| 24 | public function editors(...$editors) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Integrate with DataTables Editor. |
||
| 35 | * |
||
| 36 | * @param array|Editor $fields |
||
| 37 | * @return $this |
||
| 38 | * @see https://editor.datatables.net/ |
||
| 39 | * @throws \Exception |
||
| 40 | */ |
||
| 41 | public function editor($fields) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param array|Editor $fields |
||
| 54 | * @return array|Editor |
||
| 55 | * @throws \Exception |
||
| 56 | */ |
||
| 57 | protected function newEditor($fields) |
||
| 76 | } |
||
| 77 |
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: