1 | <?php |
||
7 | trait SoftDeletingScope |
||
8 | { |
||
9 | /** |
||
10 | * Add the with-trashed extension to the builder. |
||
11 | * |
||
12 | * @return $this |
||
13 | */ |
||
14 | public function withTrashed() |
||
15 | { |
||
16 | $this->methods[] = new Method(__FUNCTION__); |
||
|
|||
17 | |||
18 | return $this; |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Add the without-trashed extension to the builder. |
||
23 | * |
||
24 | * @return $this |
||
25 | */ |
||
26 | public function withoutTrashed() |
||
32 | |||
33 | /** |
||
34 | * Add the only-trashed extension to the builder. |
||
35 | * |
||
36 | * @return $this |
||
37 | */ |
||
38 | public function onlyTrashed() |
||
44 | } |
||
45 |
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: