Completed
Push — master ( 84505b...5678fc )
by Ivannis Suárez
02:56
created

Projection::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Domain\EventSourcing\Projector;
13
14
use Cubiche\Core\Cqrs\ReadModelInterface;
15
16
/**
17
 * Projection class.
18
 *
19
 * @author Ivannis Suárez Jerez <[email protected]>
20
 */
21
class Projection
22
{
23
    /**
24
     * @var ReadModelInterface
25
     */
26
    protected $readModel;
27
28
    /**
29
     * @var Action
30
     */
31
    protected $action;
32
33
    /**
34
     * Projection constructor.
35
     *
36
     * @param ReadModelInterface $readModel
37
     * @param Action             $action
38
     */
39
    public function __construct(ReadModelInterface $readModel, Action $action)
40
    {
41
        $this->readModel = $readModel;
42
        $this->action = $action;
43
    }
44
45
    /**
46
     * @return ReadModelInterface
47
     */
48
    public function readModel()
49
    {
50
        return $this->readModel;
51
    }
52
53
    /**
54
     * @param ReadModelInterface $readModel
55
     */
56
    public function setReadModel(ReadModelInterface $readModel)
57
    {
58
        $this->readModel = $readModel;
59
    }
60
61
    /**
62
     * @return Action
63
     */
64
    public function action()
65
    {
66
        return $this->action;
67
    }
68
69
    /**
70
     * @param Action $action
71
     */
72
    public function setAction(Action $action)
73
    {
74
        $this->action = $action;
75
    }
76
}
77