-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add annotations for orm mapping in addition to attributes to be compa…
…tible with both implementation
- Loading branch information
Louis Fortunier
committed
Mar 28, 2024
1 parent
e9651f8
commit 43dc5f4
Showing
6 changed files
with
91 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,34 +8,63 @@ | |
|
||
/** | ||
* @author Louis Fortunier <[email protected]> | ||
* | ||
* @ORM\Table(name="batch_log") | ||
* @ORM\Entity(repositoryClass="Smart\SonataBundle\Repository\Log\BatchLogRepository") | ||
*/ | ||
#[ORM\Table(name: 'batch_log')] | ||
#[ORM\Entity(repositoryClass: BatchLogRepository::class)] | ||
class BatchLog | ||
{ | ||
/** | ||
* @ORM\Id | ||
* @ORM\GeneratedValue | ||
* @ORM\Column | ||
*/ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column] | ||
private ?int $id = null; | ||
|
||
#[ORM\Column(type: Types::DATE_MUTABLE)] | ||
/** | ||
* @ORM\Column(type=Types::DATETIME_MUTABLE) | ||
*/ | ||
#[ORM\Column(type: Types::DATETIME_MUTABLE)] | ||
private ?\DateTime $date = null; | ||
|
||
/** | ||
* @ORM\Column(length=255) | ||
*/ | ||
#[ORM\Column(length: 255)] | ||
private ?string $context = null; | ||
|
||
/** | ||
* @ORM\Column(length=255) | ||
*/ | ||
#[ORM\Column(length: 255)] | ||
private ?string $name = null; | ||
|
||
/** | ||
* @ORM\Column(type="text", nullable=true) | ||
*/ | ||
#[ORM\Column(type: Types::TEXT, nullable: true)] | ||
private ?string $summary = null; | ||
|
||
/** | ||
* @ORM\Column(type="text", nullable=true) | ||
*/ | ||
#[ORM\Column(type: Types::TEXT, nullable: true)] | ||
private ?string $comment = null; | ||
|
||
/** | ||
* @ORM\Column(nullable=true) | ||
*/ | ||
#[ORM\Column(nullable: true)] | ||
private ?array $data = null; | ||
|
||
/** | ||
* @ORM\Column(nullable=true) | ||
*/ | ||
#[ORM\Column(nullable: true)] | ||
private ?bool $success = null; | ||
|
||
|
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 |
---|---|---|
|
@@ -13,39 +13,62 @@ | |
|
||
/** | ||
* @author Mathieu Ducrot <[email protected]> | ||
* | ||
* @ORM\Table(name="smart_parameter") | ||
* @ORM\Entity(repositoryClass="Smart\SonataBundle\Repository\ParameterRepository") | ||
*/ | ||
#[ORM\Table(name: "smart_parameter")] | ||
#[ORM\Entity(repositoryClass: "Smart\SonataBundle\Repository\ParameterRepository")] | ||
class Parameter implements ParameterInterface | ||
{ | ||
use HistorizableTrait; | ||
|
||
/** | ||
* @ORM\Id | ||
* @ORM\GeneratedValue | ||
* @ORM\Column | ||
*/ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column] | ||
private ?int $id = null; | ||
|
||
/** | ||
* @ORM\Column(name="code", unique=true, nullable=false) | ||
*/ | ||
#[ORM\Column(name: "code", unique: true, nullable: false)] | ||
private string $code; | ||
|
||
/** | ||
* @ORM\Column(name="value", type="text", nullable=false) | ||
*/ | ||
#[ORM\Column(name: "value", type: Types::TEXT, nullable: false)] | ||
private string|bool|null $value = null; | ||
|
||
/** | ||
* @ORM\Column(name="help", type="text", nullable=true) | ||
*/ | ||
#[ORM\Column(name: "help", type: Types::TEXT, nullable: true)] | ||
private ?string $help = null; | ||
|
||
/** | ||
* @ORM\Column(length=15, nullable=false, options={"default"="text"}) | ||
*/ | ||
#[ORM\Column(length: 15, nullable: false, options: ['default' => 'text'])] | ||
private string $type = ParameterTypeEnum::TEXT; | ||
|
||
/** | ||
* MDT We don't need to set the start/end delimiter when setting the regex, it is automatically added when the validate callback is triggered | ||
* @ORM\Column(length=100, nullable=true) | ||
* @Assert\Length(max=100) | ||
*/ | ||
#[ORM\Column(length: 100, nullable: true)] | ||
#[Assert\Length(max: 100)] | ||
private ?string $regex = null; | ||
|
||
/** | ||
* @param mixed $payload | ||
* @Assert\Callback | ||
*/ | ||
#[Assert\Callback] | ||
public function validate(ExecutionContextInterface $context, $payload): void | ||
|
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