1 | <?php |
||
8 | abstract class CacheableEvent |
||
9 | { |
||
10 | use SerializesModels; |
||
11 | |||
12 | /** |
||
13 | * The affected fields in the current cacheable event. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $affectedFields; |
||
18 | |||
19 | /** |
||
20 | * Cacheable model object. |
||
21 | * |
||
22 | * @var \Suitmedia\Cacheable\Contracts\CacheableModel |
||
23 | */ |
||
24 | protected $model; |
||
25 | |||
26 | /** |
||
27 | * Cache tags which are being invalidating. |
||
28 | * |
||
29 | * @var mixed |
||
30 | */ |
||
31 | protected $tags; |
||
32 | |||
33 | /** |
||
34 | * Event constructor. |
||
35 | * |
||
36 | * @param \Suitmedia\Cacheable\Contracts\CacheableModel $model |
||
37 | * @param mixed $tags |
||
38 | * @param array $affectedFields |
||
39 | */ |
||
40 | public function __construct(CacheableModel $model, $tags, $affectedFields = []) |
||
46 | |||
47 | /** |
||
48 | * Affected fields accessor. |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | public function affectedFields(): array |
||
56 | |||
57 | /** |
||
58 | * Model accessor. |
||
59 | * |
||
60 | * @return \Suitmedia\Cacheable\Contracts\CacheableModel |
||
61 | */ |
||
62 | public function model(): CacheableModel |
||
66 | |||
67 | /** |
||
68 | * Tags accessor. |
||
69 | * |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function tags() |
||
76 | } |
||
77 |