RepositoryEventBase::getModel()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Salah3id\Domains\Repository\Events;
3
4
use Illuminate\Database\Eloquent\Model;
5
use Salah3id\Domains\Repository\Contracts\RepositoryInterface;
6
7
/**
8
 * Class RepositoryEventBase
9
 * @package Salah3id\Domains\Repository\Events
10
 * @author Anderson Andrade <[email protected]>
11
 */
12
abstract class RepositoryEventBase
13
{
14
    /**
15
     * @var Model
16
     */
17
    protected $model;
18
19
    /**
20
     * @var RepositoryInterface
21
     */
22
    protected $repository;
23
24
    /**
25
     * @var string
26
     */
27
    protected $action;
28
29
    /**
30
     * @param RepositoryInterface $repository
31
     * @param Model               $model
32
     */
33
    public function __construct(RepositoryInterface $repository, Model $model = null)
34
    {
35
        $this->repository = $repository;
36
        $this->model = $model;
37
    }
38
39
    /**
40
     * @return Model|array
41
     */
42
    public function getModel()
43
    {
44
        return $this->model;
45
    }
46
47
    /**
48
     * @return RepositoryInterface
49
     */
50
    public function getRepository()
51
    {
52
        return $this->repository;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getAction()
59
    {
60
        return $this->action;
61
    }
62
}
63