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

RecordEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
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
}