1 | <?php |
||
8 | trait CascadeSoftDeletes |
||
9 | { |
||
10 | /** |
||
11 | * Boot the trait. |
||
12 | * |
||
13 | * Listen for the deleting event of a soft deleting model, and run |
||
14 | * the delete operation for any configured relationship methods. |
||
15 | * |
||
16 | * @throws \LogicException |
||
17 | */ |
||
18 | 6 | protected static function bootCascadeSoftDeletes() |
|
41 | |||
42 | |||
43 | /** |
||
44 | * Determine if the current model implements soft deletes. |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | 6 | protected function implementsSoftDeletes() |
|
52 | |||
53 | |||
54 | /** |
||
55 | * Get all traits used by class, including those inherited from ancestor classes. |
||
56 | * |
||
57 | * @param $class |
||
58 | * @param bool $autoload |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | 6 | protected function getClassTraits($class, $autoload = true) { |
|
72 | |||
73 | |||
74 | /** |
||
75 | * Determine if the current model has any invalid cascading relationships defined. |
||
76 | * |
||
77 | * A relationship is considered invalid when the method does not exist, or the relationship |
||
78 | * method does not return an instance of Illuminate\Database\Eloquent\Relations\Relation. |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | protected function hasInvalidCascadingRelationships() |
||
88 | |||
89 | |||
90 | /** |
||
91 | * Fetch the defined cascading soft deletes for this model. |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | 5 | protected function getCascadingDeletes() |
|
99 | } |
||
100 |