Completed
Push — master ( 1d77f8...1d8075 )
by Richan
01:31
created

CacheableEvent::model()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Suitmedia\Cacheable\Events;
4
5
use Illuminate\Queue\SerializesModels;
6
use Suitmedia\Cacheable\Contracts\CacheableModel;
7
8
abstract class CacheableEvent
9
{
10
    use SerializesModels;
11
12
    /**
13
     * Cacheable model object.
14
     *
15
     * @var \Suitmedia\Cacheable\Contracts\CacheableModel
16
     */
17
    protected $model;
18
19
    /**
20
     * Cache tags which are being invalidating.
21
     *
22
     * @var mixed
23
     */
24
    protected $tags;
25
26
    /**
27
     * Event constructor.
28
     *
29
     * @param \Suitmedia\Cacheable\Contracts\CacheableModel $model
30
     * @param mixed                                         $tags
31
     */
32
    public function __construct(CacheableModel $model, $tags)
33
    {
34
        $this->model = $model;
35
        $this->tags = $tags;
36
    }
37
38
    /**
39
     * Model accessor.
40
     *
41
     * @return \Suitmedia\Cacheable\Contracts\CacheableModel
42
     */
43
    public function model()
44
    {
45
        return $this->model;
46
    }
47
48
    /**
49
     * Tags accessor.
50
     *
51
     * @return mixed
52
     */
53
    public function tags()
54
    {
55
        return $this->tags;
56
    }
57
}
58