FixtureEvent::setFixture()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine-fixture-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\DoctrineFixtureModule\Event;
7
8
use Doctrine\Fixture\Fixture;
9
use Nnx\DoctrineFixtureModule\Executor\ExecutorAwareTrait;
10
use Zend\EventManager\Event;
11
12
/**
13
 * Class FixtureEvent
14
 *
15
 * @package Nnx\DoctrineFixtureModule\Event
16
 */
17
class FixtureEvent extends Event
18
{
19
    use ExecutorAwareTrait;
20
21
    /**
22
     * Имя события бросаемоего когда происходит выполнение фикстуры
23
     *
24
     * @var string
25
     */
26
    const EXECUTE_FIXTURE_EVENT = 'executeFixture.fixtureExecutor';
27
28
    /**
29
     * Имя действия когда происходит загрузка данных из фикстуры
30
     *
31
     * @var string
32
     */
33
    const IMPORT = 'import';
34
35
    /**
36
     * Имя действия когда происходит откат данных
37
     *
38
     * @var string
39
     */
40
    const PURGE = 'purge';
41
42
    /**
43
     * Действие которое выполняет фикстура
44
     *
45
     * @var string
46
     */
47
    protected $method;
48
49
    /**
50
     * Обрабатываемя фикстура
51
     *
52
     * @var Fixture
53
     */
54
    protected $fixture;
55
56
    /**
57
     * Возвращает имя действия которое выполняет фикстура
58
     *
59
     * @return string
60
     */
61
    public function getMethod()
62
    {
63
        return $this->method;
64
    }
65
66
    /**
67
     * Устанавливает имя действия которое выполняет фикстура
68
     *
69
     * @param string $method
70
     *
71
     * @return $this
72
     */
73
    public function setMethod($method)
74
    {
75
        $this->method = $method;
76
77
        return $this;
78
    }
79
80
    /**
81
     * Возвращает обрабатываемую фикстуру
82
     *
83
     * @return Fixture
84
     */
85
    public function getFixture()
86
    {
87
        return $this->fixture;
88
    }
89
90
    /**
91
     * Устанавливает обрабатываемую фикстуру
92
     *
93
     * @param Fixture $fixture
94
     *
95
     * @return $this
96
     */
97
    public function setFixture(Fixture $fixture)
98
    {
99
        $this->fixture = $fixture;
100
101
        return $this;
102
    }
103
}
104