From 5d83353fff5bdffce0d10a58f68b02556f371e02 Mon Sep 17 00:00:00 2001 From: juniwalk Date: Fri, 29 Jul 2022 11:18:14 +0200 Subject: [PATCH] Added support for doctrine/orm attributes --- src/Entity/Record.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Entity/Record.php b/src/Entity/Record.php index 7fea993..75141d4 100644 --- a/src/Entity/Record.php +++ b/src/Entity/Record.php @@ -15,55 +15,64 @@ /** * @ORM\MappedSuperclass */ +#[ORM\MappedSuperclass] abstract class Record { /** * @ORM\Column(type="string", length=16) * @var string */ - protected $type = 'log'; + #[ORM\Column(type: "string", length: 16)] + protected string $type = 'log'; /** * @ORM\Column(type="string", length=64) * @var string */ - protected $event; + #[ORM\Column(type: "string", length: 64)] + protected string $event; /** * @ORM\Column(type="string") * @var string|null */ - protected $message; + #[ORM\Column(type: "string")] + protected ?string $message; /** * @ORM\Column(type="datetimetz") * @var DateTime */ - protected $date; + #[ORM\Column(type: "datetimetz")] + protected DateTime $date; /** * @ORM\Column(type="string", length=16) * @var string */ - protected $level = 'secondary'; + #[ORM\Column(type: "string", length: 16)] + protected string $level = 'secondary'; /** * @ORM\Column(type="boolean") * @var bool */ - protected $isFinished = false; + #[ORM\Column(type: "boolean")] + protected bool $isFinished = false; /** * @ORM\Column(type="json", nullable=true) * @var string[] */ - protected $params; + #[ORM\Column(type: "json", nullable: true)] + protected ?array $params; /** * @ORM\Column(type="text", nullable=true) * @var string|null */ - protected $note; + #[ORM\Column(type: "text", nullable: true)] + protected ?string $note; /**