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 | */ |
||
39 | public function __construct(CacheableModel $model, $tags, $affectedFields = []) |
||
45 | |||
46 | /** |
||
47 | * Affected fields accessor. |
||
48 | * |
||
49 | * @return array |
||
50 | */ |
||
51 | public function affectedFields() |
||
55 | |||
56 | /** |
||
57 | * Model accessor. |
||
58 | * |
||
59 | * @return \Suitmedia\Cacheable\Contracts\CacheableModel |
||
60 | */ |
||
61 | public function model() |
||
65 | |||
66 | /** |
||
67 | * Tags accessor. |
||
68 | * |
||
69 | * @return mixed |
||
70 | */ |
||
71 | public function tags() |
||
75 | } |
||
76 |