From f9e4553fa70997737abbf995af2ae9e91eb32508 Mon Sep 17 00:00:00 2001 From: Julio Date: Thu, 16 Sep 2021 10:04:07 +0200 Subject: [PATCH] Migration - Fix entities --- src/CoreBundle/Entity/GradebookCategory.php | 4 ++-- src/CoreBundle/Entity/User.php | 2 +- src/CourseBundle/Entity/CCalendarEvent.php | 4 +++- src/CourseBundle/Entity/CForumPost.php | 2 +- src/CourseBundle/Entity/CForumThread.php | 2 +- src/CourseBundle/Entity/CGroup.php | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CoreBundle/Entity/GradebookCategory.php b/src/CoreBundle/Entity/GradebookCategory.php index ea2163fd4c..c3f46b05ad 100644 --- a/src/CoreBundle/Entity/GradebookCategory.php +++ b/src/CoreBundle/Entity/GradebookCategory.php @@ -116,7 +116,7 @@ class GradebookCategory /** * @ORM\Column(name="visible", type="boolean", nullable=false) */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $visible; /** @@ -143,7 +143,7 @@ class GradebookCategory /** * @ORM\Column(name="generate_certificates", type="boolean", nullable=false) */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $generateCertificates; /** diff --git a/src/CoreBundle/Entity/User.php b/src/CoreBundle/Entity/User.php index 3a67e05756..1621f53bcc 100644 --- a/src/CoreBundle/Entity/User.php +++ b/src/CoreBundle/Entity/User.php @@ -247,7 +247,7 @@ class User implements UserInterface, EquatableInterface, ResourceInterface, Reso * @Groups({"user:read", "user:write"}) * @ORM\Column(name="enabled", type="boolean") */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $enabled; /** diff --git a/src/CourseBundle/Entity/CCalendarEvent.php b/src/CourseBundle/Entity/CCalendarEvent.php index 5dcde0a193..f078ae5b34 100644 --- a/src/CourseBundle/Entity/CCalendarEvent.php +++ b/src/CourseBundle/Entity/CCalendarEvent.php @@ -134,6 +134,7 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface * @ORM\Column(name="all_day", type="boolean", nullable=false) */ #[Groups(['calendar_event:read', 'calendar_event:write'])] + #[Assert\NotNull] protected bool $allDay; /** @@ -163,9 +164,10 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface protected Collection $attachments; /** - * @ORM\Column(name="collective", type="boolean", options={"default": false}, nullable=false) + * @ORM\Column(name="collective", type="boolean", nullable=false) */ #[Groups(['calendar_event:read', 'calendar_event:write'])] + #[Assert\NotNull] protected bool $collective = false; public function __construct() diff --git a/src/CourseBundle/Entity/CForumPost.php b/src/CourseBundle/Entity/CForumPost.php index 6531f9dbb9..2972324ef7 100644 --- a/src/CourseBundle/Entity/CForumPost.php +++ b/src/CourseBundle/Entity/CForumPost.php @@ -66,7 +66,7 @@ class CForumPost extends AbstractResource implements ResourceInterface /** * @ORM\Column(name="visible", type="boolean", nullable=false) */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $visible; /** diff --git a/src/CourseBundle/Entity/CForumThread.php b/src/CourseBundle/Entity/CForumThread.php index bde37384c5..a7c7aaa0eb 100644 --- a/src/CourseBundle/Entity/CForumThread.php +++ b/src/CourseBundle/Entity/CForumThread.php @@ -99,7 +99,7 @@ class CForumThread extends AbstractResource implements ResourceInterface /** * @ORM\Column(name="thread_sticky", type="boolean", nullable=false) */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $threadSticky; /** diff --git a/src/CourseBundle/Entity/CGroup.php b/src/CourseBundle/Entity/CGroup.php index 907bb2f384..ae746603a9 100644 --- a/src/CourseBundle/Entity/CGroup.php +++ b/src/CourseBundle/Entity/CGroup.php @@ -58,7 +58,7 @@ class CGroup extends AbstractResource implements ResourceInterface /** * @ORM\Column(name="status", type="boolean", nullable=false) */ - #[Assert\NotBlank] + #[Assert\NotNull] protected bool $status; /**