Completed
Branch feature/pre-split (4cb052)
by Anton
03:34
created

RecordEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Events;
8
9
use Spiral\Models\EntityInterface;
10
use Spiral\Models\Events\EntityEvent;
11
use Spiral\ORM\CommandInterface;
12
13
class RecordEvent extends EntityEvent
14
{
15
    /**
16
     * @var CommandInterface
17
     */
18
    private $command;
19
20
    /**
21
     * @param EntityInterface  $entity
22
     * @param CommandInterface $command
23
     */
24
    public function __construct(EntityInterface $entity, CommandInterface $command)
25
    {
26
        parent::__construct($entity);
27
        $this->command = $command;
28
    }
29
30
    /**
31
     * Command associated with entity operation.
32
     *
33
     * @return CommandInterface
34
     */
35
    public function getCommand(): CommandInterface
36
    {
37
        return $this->command;
38
    }
39
}