RepositoryEventBase::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\Platfourm\Repository\Events;
12
13
use Illuminate\Database\Eloquent\Model;
14
use Longman\Platfourm\Contracts\Repository\Repository;
15
16
/**
17
 * Class RepositoryEventBase.
18
 */
19
abstract class RepositoryEventBase
20
{
21
    /**
22
     * @var Model
23
     */
24
    protected $model;
25
26
    /**
27
     * @var Repository
28
     */
29
    protected $repository;
30
31
    /**
32
     * @var string
33
     */
34
    protected $action;
35
36
    /**
37
     * @param Repository $repository
38
     * @param Model      $model
39
     */
40
    public function __construct(Repository $repository, Model $model)
41
    {
42
        $this->repository = $repository;
43
        $this->model      = $model;
44
    }
45
46
    /**
47
     * @return Model
48
     */
49
    public function getModel()
50
    {
51
        return $this->model;
52
    }
53
54
    /**
55
     * @return Repository
56
     */
57
    public function getRepository()
58
    {
59
        return $this->repository;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getAction()
66
    {
67
        return $this->action;
68
    }
69
}
70