From 9ba74e646d42a3299dfbc3810e989c403c385b7f Mon Sep 17 00:00:00 2001 From: Thilo Ratnaweera Date: Wed, 18 Jan 2023 15:05:47 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20Resolves=20#11=20VersionColumn?= =?UTF-8?q?=20trait=20with=20attributes=20-=20stricter=20type=20for=20vers?= =?UTF-8?q?ion=20column=20+=20not=20nullable=20-=20added=20support=20for?= =?UTF-8?q?=20attributes=20-=20legacy=20support=20for=20annotations=20-=20?= =?UTF-8?q?cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Traits/VersionColumn.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/Traits/VersionColumn.php b/src/Traits/VersionColumn.php index c3c73bd..5ac9dc6 100644 --- a/src/Traits/VersionColumn.php +++ b/src/Traits/VersionColumn.php @@ -1,33 +1,25 @@ version; } - -} \ No newline at end of file +} From 9bdf202955ea2db4099064fc68e4a60bffceb6bb Mon Sep 17 00:00:00 2001 From: Thilo Ratnaweera Date: Wed, 18 Jan 2023 16:22:33 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20#11=20restored=20default=20v?= =?UTF-8?q?alue=20for=20manual=20inserts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Traits/VersionColumn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Traits/VersionColumn.php b/src/Traits/VersionColumn.php index 5ac9dc6..edd3641 100644 --- a/src/Traits/VersionColumn.php +++ b/src/Traits/VersionColumn.php @@ -13,9 +13,9 @@ trait VersionColumn { /** - * @ORM\Column(type="integer", nullable=false) + * @ORM\Column(type="integer", nullable=false, options={"default": 1}) */ - #[ORM\Column(type: 'integer', nullable: false)] + #[ORM\Column(type: 'integer', nullable: false, options: [ 'default' => 1])] private int $version = 1; public function getVersion(): int From 61165962d839c1370b47b9e30f120f868076024a Mon Sep 17 00:00:00 2001 From: Thilo Ratnaweera Date: Wed, 18 Jan 2023 16:29:12 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=A8=20#11=20Cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Traits/VersionColumn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/VersionColumn.php b/src/Traits/VersionColumn.php index edd3641..5dd17b6 100644 --- a/src/Traits/VersionColumn.php +++ b/src/Traits/VersionColumn.php @@ -15,7 +15,7 @@ trait VersionColumn /** * @ORM\Column(type="integer", nullable=false, options={"default": 1}) */ - #[ORM\Column(type: 'integer', nullable: false, options: [ 'default' => 1])] + #[ORM\Column(type: 'integer', nullable: false, options: ['default' => 1])] private int $version = 1; public function getVersion(): int From 5dcbe7b43c237daf3504b4f43210eb89710bb932 Mon Sep 17 00:00:00 2001 From: Thilo Ratnaweera Date: Wed, 18 Jan 2023 16:30:32 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20#11=20allow=20usage=20in=20a?= =?UTF-8?q?bstract=20entities?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Traits/VersionColumn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/VersionColumn.php b/src/Traits/VersionColumn.php index 5dd17b6..c42c830 100644 --- a/src/Traits/VersionColumn.php +++ b/src/Traits/VersionColumn.php @@ -16,7 +16,7 @@ trait VersionColumn * @ORM\Column(type="integer", nullable=false, options={"default": 1}) */ #[ORM\Column(type: 'integer', nullable: false, options: ['default' => 1])] - private int $version = 1; + protected int $version = 1; public function getVersion(): int {