-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d009c08
commit ccb608d
Showing
10 changed files
with
45 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,11 @@ | |
/** | ||
* A "Task" is a scheduled job. | ||
* | ||
* @ORM\Table | ||
* | ||
* @ORM\Entity(repositoryClass="App\Repository\TaskRepository") | ||
* | ||
* @ORM\HasLifecycleCallbacks() | ||
* | ||
* @author Tobias Nyholm <[email protected]> | ||
*/ | ||
#[ORM\Entity(repositoryClass: \App\Repository\TaskRepository::class)] | ||
#[ORM\HasLifecycleCallbacks] | ||
#[ORM\Table] | ||
class Task | ||
{ | ||
public const ACTION_CLOSE_STALE = 1; | ||
|
@@ -23,42 +20,33 @@ class Task | |
|
||
/** | ||
* @var int | ||
* | ||
* @ORM\Column(name="id", type="integer") | ||
* | ||
* @ORM\Id | ||
* | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
#[ORM\Column(name: 'id', type: 'integer')] | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue(strategy: 'AUTO')] | ||
private $id; | ||
|
||
/** | ||
* @var \DateTimeImmutable | ||
* | ||
* @ORM\Column(type="datetime_immutable") | ||
*/ | ||
#[ORM\Column(type: 'datetime_immutable')] | ||
private $createdAt; | ||
|
||
/** | ||
* @var \DateTimeImmutable | ||
* | ||
* @ORM\Column(type="datetime_immutable") | ||
*/ | ||
#[ORM\Column(type: 'datetime_immutable')] | ||
private $updatedAt; | ||
|
||
public function __construct(/** | ||
* @ORM\Column(type="string") | ||
*/ | ||
private string $repositoryFullName, /** | ||
* @ORM\Column(type="integer") | ||
*/ | ||
private int $number, /** | ||
* @ORM\Column(type="integer") | ||
*/ | ||
private int $action, /** | ||
* @ORM\Column(type="datetime_immutable") | ||
*/ | ||
private \DateTimeImmutable $verifyAfter) | ||
public function __construct( | ||
#[ORM\Column(type: 'string')] | ||
private readonly string $repositoryFullName, | ||
#[ORM\Column(type: 'integer')] | ||
private readonly int $number, | ||
#[ORM\Column(type: 'integer')] | ||
private readonly int $action, | ||
#[ORM\Column(type: 'datetime_immutable')] | ||
private \DateTimeImmutable $verifyAfter) | ||
{ | ||
$this->createdAt = new \DateTimeImmutable(); | ||
} | ||
|
@@ -93,11 +81,8 @@ public function setVerifyAfter(\DateTimeImmutable $verifyAfter): void | |
$this->verifyAfter = $verifyAfter; | ||
} | ||
|
||
/** | ||
* @ORM\PrePersist | ||
* | ||
* @ORM\PreUpdate | ||
*/ | ||
#[ORM\PrePersist] | ||
#[ORM\PreUpdate] | ||
public function updateUpdatedAt() | ||
{ | ||
$this->updatedAt = new \DateTimeImmutable(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters