1 | <?php |
||
9 | class VarnishableObserver |
||
10 | { |
||
11 | /** |
||
12 | * Varnishable Service Object. |
||
13 | * |
||
14 | * @var \RichanFongdasen\Varnishable\VarnishableService |
||
15 | */ |
||
16 | protected $varnishable; |
||
17 | |||
18 | /** |
||
19 | * Varnishable Observer constructor. |
||
20 | */ |
||
21 | public function __construct() |
||
25 | |||
26 | /** |
||
27 | * Listening to any saved events. |
||
28 | * |
||
29 | * @param \Illuminate\Database\Eloquent\Model $model |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function deleted(Model $model) :void |
||
37 | |||
38 | /** |
||
39 | * Handle any retrieved and wakeup events on |
||
40 | * the observed models. |
||
41 | * |
||
42 | * @param \Illuminate\Database\Eloquent\Model $model |
||
43 | * |
||
44 | * @throws Exception |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | protected function handleModelInitialization(Model $model) :void |
||
56 | |||
57 | /** |
||
58 | * Handle any update events on the observed models. |
||
59 | * |
||
60 | * @param \Illuminate\Database\Eloquent\Model $model |
||
61 | * |
||
62 | * @return void |
||
63 | */ |
||
64 | protected function handleModelUpdates(Model $model) :void |
||
68 | |||
69 | /** |
||
70 | * Listening to any saved events. |
||
71 | * |
||
72 | * @param \Illuminate\Database\Eloquent\Model $model |
||
73 | * |
||
74 | * @return void |
||
75 | */ |
||
76 | public function restored(Model $model) :void |
||
80 | |||
81 | /** |
||
82 | * Listening to any retrieved events. |
||
83 | * |
||
84 | * @param \Illuminate\Database\Eloquent\Model $model |
||
85 | * |
||
86 | * @return void |
||
87 | */ |
||
88 | public function retrieved(Model $model) :void |
||
92 | |||
93 | /** |
||
94 | * Listening to any saved events. |
||
95 | * |
||
96 | * @param \Illuminate\Database\Eloquent\Model $model |
||
97 | * |
||
98 | * @return void |
||
99 | */ |
||
100 | public function saved(Model $model) :void |
||
104 | |||
105 | /** |
||
106 | * Listening to any wakeup events. |
||
107 | * |
||
108 | * @param \Illuminate\Database\Eloquent\Model $model |
||
109 | * |
||
110 | * @return void |
||
111 | */ |
||
112 | public function wakeup(Model $model) :void |
||
116 | } |
||
117 |