forked from ezsystems/JMSJobQueueBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCronJob.php
More file actions
42 lines (34 loc) · 879 Bytes
/
CronJob.php
File metadata and controls
42 lines (34 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace JMS\JobQueueBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
#[ORM\Entity]
#[ORM\Table(name: "jms_cron_jobs")]
#[ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")]
#[ORM\MappedSuperclass]
class CronJob
{
#[ORM\Id]
#[ORM\Column(type: "integer", options: ["unsigned" => true])]
#[ORM\GeneratedValue(strategy: "AUTO")]
private $id;
#[ORM\Column(type: "string", length: 200, unique: true)]
private $command;
#[ORM\Column(name: "lastRunAt", type: "datetime")]
private $lastRunAt;
public function __construct($command)
{
$this->command = $command;
$this->lastRunAt = new \DateTime();
}
public function getCommand()
{
return $this->command;
}
public function getLastRunAt()
{
return $this->lastRunAt;
}
}