Completed
Push — master ( b416d7...51a9f1 )
by Filipe
02:48
created

EntityAdded::getCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of slick/orm package
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Orm\Event;
11
use Slick\Orm\Entity\EntityCollectionInterface;
12
13
/**
14
 * Entity Added: triggered when an entity is added to an entity collection
15
 * 
16
 * @package Slick\Orm\Event
17
 * @author  Filipe Silva <[email protected]>
18
 */
19
class EntityAdded extends AbstractEvent implements EventInterface
20
{
21
    
22
    const ACTION_ADD = 'entity.added';
23
24
    /**
25
     * @var string
26
     */
27
    protected $name = 'EntityAdded';
28
29
    /**
30
     * @var string
31
     */
32
    protected $action = self::ACTION_ADD;
33
34
    /**
35
     * Gets the entity collection that triggers the event
36
     * 
37
     * @return EntityCollectionInterface
38
     */
39 2
    public function getCollection()
40
    {
41 2
        return $this->params['collection'];
42
    }
43
}