CronJob::getLastRunAt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace JMS\JobQueueBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\Table(name = "jms_cron_jobs")
10
 * @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
11
 */
12
class CronJob
13
{
14
    /** @ORM\Id @ORM\Column(type = "integer", options = {"unsigned": true}) @ORM\GeneratedValue(strategy="AUTO") */
15
    private $id;
16
17
    /** @ORM\Column(type = "string", length = 200, unique = true) */
18
    private $command;
19
20
    /** @ORM\Column(type = "datetime", name = "lastRunAt") */
21
    private $lastRunAt;
22
23 2
    public function __construct($command)
24
    {
25 2
        $this->command = $command;
26 2
        $this->lastRunAt = new \DateTime();
27 2
    }
28
29
    public function getCommand()
30
    {
31
        return $this->command;
32
    }
33
34 2
    public function getLastRunAt()
35
    {
36 2
        return $this->lastRunAt;
37
    }
38
}