Completed
Push — master ( c4e3cd...c5cae6 )
by Anton
05:38
created

EntityEvent::entity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Spiral Framework.
4
 *
5
 * @license   MIT
6
 * @author    Anton Titov (Wolfy-J)
7
 */
8
9
namespace Spiral\Models\Events;
10
11
use Spiral\Models\EntityInterface;
12
use Symfony\Component\EventDispatcher\Event;
13
14
/**
15
 * Entity specific event.
16
 */
17
class EntityEvent extends Event
18
{
19
    /**
20
     * @var null|EntityInterface
21
     */
22
    private $entity = null;
23
24
    /**
25
     * @param EntityInterface $entity
26
     */
27
    public function __construct(EntityInterface $entity)
28
    {
29
        $this->entity = $entity;
30
    }
31
32
    /**
33
     * @return null|EntityInterface
34
     */
35
    public function entity()
36
    {
37
        return $this->entity;
38
    }
39
}