Completed
Push — master ( cd662c...9cefff )
by Filipe
02:43
created

Select::getQuery()   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
 * Created by PhpStorm.
4
 * User: fsilva
5
 * Date: 09-03-2016
6
 * Time: 18:47
7
 */
8
9
namespace Slick\Orm\Event;
10
11
12
use Slick\Database\RecordList;
13
use Slick\Orm\Entity\EntityCollection;
14
15
class Select extends AbstractEvent implements EventInterface
16
{
17
18
    const ACTION_BEFORE_SELECT = 'before.select';
19
    const ACTION_AFTER_SELECT  = 'after.select';
20
21
    /**
22
     * @var string
23
     */
24
    protected $name = 'Select';
25
26
    /**
27
     * @var string
28
     */
29
    protected $action = self::ACTION_BEFORE_SELECT;
30
31
    /**
32
     * Gets select query
33
     *
34
     * @return \Slick\Database\Sql\Select
35
     */
36 2
    public function getQuery()
37
    {
38 2
        return $this->params['query'];
39
    }
40
41
    /**
42
     * Gets data returned from query
43
     *
44
     * @return RecordList|null
45
     */
46 2
    public function getData()
47
    {
48 2
        return $this->params['data'];
49
    }
50
51
    /**
52
     * Gets already mapped entity collection
53
     *
54
     * @return EntityCollection
55
     */
56 2
    public function getEntityCollection()
57
    {
58 2
        return $this->params['entityCollection'];
59
    }
60
}