Passed
Push — main ( 987cb0...4f2490 )
by De Cramer
02:59
created

EtlExecution::getCreateTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Oliverde8\PhpEtlBundle\Entity;
4
5
use Oliverde8\PhpEtlBundle\Repository\EtlExecutionRepository;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity(repositoryClass=EtlExecutionRepository::class)
10
 */
11
class EtlExecution
12
{
13
    public const STATUS_WAITING ="waiting";
14
    public const STATUS_QUEUED ="queued";
15
    public const STATUS_RUNNING = "running";
16
    public const STATUS_SUCCESS = "success";
17
    public const STATUS_FAILURE = "failure";
18
19
    /**
20
     * @ORM\Id
21
     * @ORM\GeneratedValue
22
     * @ORM\Column(type="integer")
23
     */
24
    private $id;
25
26
    /**
27
     * @ORM\Column(type="string", length=255)
28
     */
29
    private $name;
30
31
    /**
32
     * @ORM\Column(type="string", length=255, nullable=true)
33
     */
34
    private $username;
35
36
    /**
37
     * @ORM\Column(type="text", nullable=true)
38
     */
39
    private $inputData;
40
41
    /**
42
     * @ORM\Column(type="text", nullable=true)
43
     */
44
    private $inputOptions;
45
46
    /**
47
     * @ORM\Column(type="datetime")
48
     */
49
    private $createTime;
50
51
    /**
52
     * @ORM\Column(type="datetime", nullable=true)
53
     */
54
    private $startTime;
55
56
    /**
57
     * @ORM\Column(type="datetime", nullable=true)
58
     */
59
    private $endTime;
60
61
    /**
62
     * @ORM\Column(type="datetime", nullable=true)
63
     */
64
    private $failTime;
65
66
    /**
67
     * @ORM\Column(type="text")
68
     */
69
    private $definition;
70
71
    /**
72
     * @ORM\Column(type="text", nullable=true)
73
     */
74
    private $errorMessage;
75
76
    /**
77
     * @ORM\Column(type="text", nullable=true)
78
     */
79
    private $stepStats;
80
81
    /**
82
     * @ORM\Column(type="string", length=255)
83
     */
84
    private $status;
85
86
    /**
87
     * EtlExecution constructor.
88
     * @param string $name
89
     * @param string $definition
90
     */
91
    public function __construct(string $name, string $definition, array $inputData, array $inputOptions)
92
    {
93
        $this->name = $name;
94
        $this->definition = $definition;
95
        $this->createTime = new \DateTime();
96
        $this->status = self::STATUS_WAITING;
97
98
        $this->inputData = json_encode($inputData);
99
        $this->inputOptions = json_encode($inputOptions);
100
    }
101
102
103
    public function getId(): ?int
104
    {
105
        return $this->id;
106
    }
107
108
    public function getName(): ?string
109
    {
110
        return $this->name;
111
    }
112
113
    public function setName(string $name): self
114
    {
115
        $this->name = $name;
116
117
        return $this;
118
    }
119
120
    /**
121
     * @return mixed
122
     */
123
    public function getUsername()
124
    {
125
        return $this->username;
126
    }
127
128
    /**
129
     * @param mixed $username
130
     */
131
    public function setUsername($username): void
132
    {
133
        $this->username = $username;
134
    }
135
136
    /**
137
     * @return mixed
138
     */
139
    public function getInputData()
140
    {
141
        return $this->inputData;
142
    }
143
144
    /**
145
     * @param mixed $inputData
146
     */
147
    public function setInputData($inputData): void
148
    {
149
        $this->inputData = $inputData;
150
    }
151
152
    /**
153
     * @return mixed
154
     */
155
    public function getInputOptions()
156
    {
157
        return $this->inputOptions;
158
    }
159
160
    /**
161
     * @param mixed $inputOptions
162
     */
163
    public function setInputOptions($inputOptions): void
164
    {
165
        $this->inputOptions = $inputOptions;
166
    }
167
168
    public function getCreateTime(): \DateTime
169
    {
170
        return $this->createTime;
171
    }
172
173
    public function setCreateTime(\DateTime $createTime): void
174
    {
175
        $this->createTime = $createTime;
176
    }
177
178
    public function getStartTime(): ?\DateTimeInterface
179
    {
180
        return $this->startTime;
181
    }
182
183
    public function setStartTime(\DateTimeInterface $startTime): self
184
    {
185
        $this->startTime = $startTime;
186
187
        return $this;
188
    }
189
190
    /**
191
     * @return mixed
192
     */
193
    public function getFailTime()
194
    {
195
        return $this->failTime;
196
    }
197
198
    /**
199
     * @param mixed $failTime
200
     */
201
    public function setFailTime($failTime): void
202
    {
203
        $this->failTime = $failTime;
204
    }
205
206
    public function getEndTime(): ?\DateTimeInterface
207
    {
208
        return $this->endTime;
209
    }
210
211
    public function setEndTime(?\DateTimeInterface $endTime): self
212
    {
213
        $this->endTime = $endTime;
214
215
        return $this;
216
    }
217
218
    /**
219
     * @return mixed
220
     */
221
    public function getErrorMessage()
222
    {
223
        return $this->errorMessage;
224
    }
225
226
    /**
227
     * @param mixed $errorMessage
228
     */
229
    public function setErrorMessage($errorMessage): void
230
    {
231
        $this->errorMessage = $errorMessage;
232
    }
233
234
    public function getDefinition(): ?string
235
    {
236
        return $this->definition;
237
    }
238
239
    public function setDefinition(string $definition): self
240
    {
241
        $this->definition = $definition;
242
243
        return $this;
244
    }
245
246
    public function getStepStats(): ?string
247
    {
248
        return $this->stepStats;
249
    }
250
251
    public function setStepStats(?string $stepStats): self
252
    {
253
        $this->stepStats = $stepStats;
254
255
        return $this;
256
    }
257
258
    /**
259
     * @return string
260
     */
261
    public function getStatus(): string
262
    {
263
        return $this->status;
264
    }
265
266
    /**
267
     * @param string $status
268
     */
269
    public function setStatus(string $status): void
270
    {
271
        $this->status = $status;
272
    }
273
}
274