From dbcd95abdac26d452d0219caa3dbbc183e19dbca Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 9 Sep 2020 11:07:46 +0200 Subject: [PATCH] Internal: Add @Assert\NotBlank() --- src/CourseBundle/Entity/CAnnouncement.php | 3 +++ src/CourseBundle/Entity/CBlog.php | 3 ++- src/CourseBundle/Entity/CCalendarEvent.php | 3 ++- src/CourseBundle/Entity/CCourseSetting.php | 3 +++ src/CourseBundle/Entity/CDropboxCategory.php | 3 +++ src/CourseBundle/Entity/CExerciseCategory.php | 10 ---------- src/CourseBundle/Entity/CForumCategory.php | 1 + src/CourseBundle/Entity/CForumForum.php | 1 + src/CourseBundle/Entity/CForumThread.php | 2 ++ src/CourseBundle/Entity/CLpItem.php | 18 +++++++++++------- src/CourseBundle/Entity/CQuizQuestion.php | 2 ++ .../Entity/CStudentPublication.php | 14 +++++++------- src/CourseBundle/Entity/CThematic.php | 2 ++ src/CourseBundle/Entity/CThematicPlan.php | 17 ++++++++++------- src/CourseBundle/Entity/CWiki.php | 2 ++ 15 files changed, 51 insertions(+), 33 deletions(-) diff --git a/src/CourseBundle/Entity/CAnnouncement.php b/src/CourseBundle/Entity/CAnnouncement.php index 454f0cac54..d6d5da01ad 100644 --- a/src/CourseBundle/Entity/CAnnouncement.php +++ b/src/CourseBundle/Entity/CAnnouncement.php @@ -7,6 +7,7 @@ namespace Chamilo\CourseBundle\Entity; use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CAnnouncement. @@ -28,6 +29,8 @@ class CAnnouncement extends AbstractResource implements ResourceInterface /** * @var string * + * @Assert\NotBlank() + * * @ORM\Column(name="title", type="text", nullable=true) */ protected $title; diff --git a/src/CourseBundle/Entity/CBlog.php b/src/CourseBundle/Entity/CBlog.php index 224bfddf51..d206907380 100644 --- a/src/CourseBundle/Entity/CBlog.php +++ b/src/CourseBundle/Entity/CBlog.php @@ -5,6 +5,7 @@ namespace Chamilo\CourseBundle\Entity; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CBlog. @@ -45,7 +46,7 @@ class CBlog /** * @var string - * + * @Assert\NotBlank() * @ORM\Column(name="blog_name", type="string", length=250, nullable=false) */ protected $blogName; diff --git a/src/CourseBundle/Entity/CCalendarEvent.php b/src/CourseBundle/Entity/CCalendarEvent.php index 69a01fb064..0e0e2eefcc 100644 --- a/src/CourseBundle/Entity/CCalendarEvent.php +++ b/src/CourseBundle/Entity/CCalendarEvent.php @@ -9,6 +9,7 @@ use Chamilo\CoreBundle\Entity\ResourceInterface; use Chamilo\CoreBundle\Entity\Room; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CCalendarEvent. @@ -42,7 +43,7 @@ class CCalendarEvent extends AbstractResource implements ResourceInterface /** * @var string - * + * @Assert\NotBlank() * @ORM\Column(name="title", type="string", length=255, nullable=false) */ protected $title; diff --git a/src/CourseBundle/Entity/CCourseSetting.php b/src/CourseBundle/Entity/CCourseSetting.php index b9301d6fca..763e308f6b 100644 --- a/src/CourseBundle/Entity/CCourseSetting.php +++ b/src/CourseBundle/Entity/CCourseSetting.php @@ -5,6 +5,7 @@ namespace Chamilo\CourseBundle\Entity; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CCourseSetting. @@ -38,6 +39,8 @@ class CCourseSetting /** * @var string * + * @Assert\NotBlank() + * * @ORM\Column(name="variable", type="string", length=255, nullable=false) */ protected $variable; diff --git a/src/CourseBundle/Entity/CDropboxCategory.php b/src/CourseBundle/Entity/CDropboxCategory.php index 2674fd6b7a..da1be5168a 100644 --- a/src/CourseBundle/Entity/CDropboxCategory.php +++ b/src/CourseBundle/Entity/CDropboxCategory.php @@ -5,6 +5,7 @@ namespace Chamilo\CourseBundle\Entity; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CDropboxCategory. @@ -46,6 +47,8 @@ class CDropboxCategory /** * @var string * + * @Assert\NotBlank() + * * @ORM\Column(name="cat_name", type="text", nullable=false) */ protected $catName; diff --git a/src/CourseBundle/Entity/CExerciseCategory.php b/src/CourseBundle/Entity/CExerciseCategory.php index 07e3e3395b..5eadae844d 100644 --- a/src/CourseBundle/Entity/CExerciseCategory.php +++ b/src/CourseBundle/Entity/CExerciseCategory.php @@ -31,16 +31,6 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface */ protected $id; - /** - * @var Course - * - * Gedmo\SortableGroup - * - * ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CExerciseCategory", inversedBy="children") - * ORM\JoinColumn(referencedColumnName="id", onDelete="SET NULL") - */ - //protected $course; - /** * @var Course * diff --git a/src/CourseBundle/Entity/CForumCategory.php b/src/CourseBundle/Entity/CForumCategory.php index a1335c9675..6036ca5124 100644 --- a/src/CourseBundle/Entity/CForumCategory.php +++ b/src/CourseBundle/Entity/CForumCategory.php @@ -42,6 +42,7 @@ class CForumCategory extends AbstractResource implements ResourceInterface /** * @var string + * * @Assert\NotBlank() * * @ORM\Column(name="cat_title", type="string", length=255, nullable=false) diff --git a/src/CourseBundle/Entity/CForumForum.php b/src/CourseBundle/Entity/CForumForum.php index 4fb400cd7e..3743f7360c 100644 --- a/src/CourseBundle/Entity/CForumForum.php +++ b/src/CourseBundle/Entity/CForumForum.php @@ -42,6 +42,7 @@ class CForumForum extends AbstractResource implements ResourceInterface /** * @var string + * * @Assert\NotBlank * * @ORM\Column(name="forum_title", type="string", length=255, nullable=false) diff --git a/src/CourseBundle/Entity/CForumThread.php b/src/CourseBundle/Entity/CForumThread.php index cd1264a252..69852a93b6 100644 --- a/src/CourseBundle/Entity/CForumThread.php +++ b/src/CourseBundle/Entity/CForumThread.php @@ -42,7 +42,9 @@ class CForumThread extends AbstractResource implements ResourceInterface /** * @var string + * * @Assert\NotBlank() + * * @ORM\Column(name="thread_title", type="string", length=255, nullable=true) */ protected $threadTitle; diff --git a/src/CourseBundle/Entity/CLpItem.php b/src/CourseBundle/Entity/CLpItem.php index 9443fba376..caa0f9ab1e 100644 --- a/src/CourseBundle/Entity/CLpItem.php +++ b/src/CourseBundle/Entity/CLpItem.php @@ -48,23 +48,27 @@ class CLpItem /** * @var string * - * @ORM\Column(name="item_type", type="string", length=32, nullable=false) + * @Assert\NotBlank() + * + * @ORM\Column(name="title", type="string", length=511, nullable=false) */ - protected $itemType; + protected $title; /** * @var string * - * @ORM\Column(name="ref", type="text", nullable=false) + * @Assert\NotBlank() + * + * @ORM\Column(name="item_type", type="string", length=32, nullable=false) */ - protected $ref; + protected $itemType; /** * @var string - * @Assert\NotBlank() - * @ORM\Column(name="title", type="string", length=511, nullable=false) + * + * @ORM\Column(name="ref", type="text", nullable=false) */ - protected $title; + protected $ref; /** * @var string diff --git a/src/CourseBundle/Entity/CQuizQuestion.php b/src/CourseBundle/Entity/CQuizQuestion.php index 8720f93334..e27b766673 100644 --- a/src/CourseBundle/Entity/CQuizQuestion.php +++ b/src/CourseBundle/Entity/CQuizQuestion.php @@ -43,7 +43,9 @@ class CQuizQuestion extends AbstractResource implements ResourceInterface /** * @var string + * * @Assert\NotBlank() + * * @ORM\Column(name="question", type="text", nullable=false) */ protected $question; diff --git a/src/CourseBundle/Entity/CStudentPublication.php b/src/CourseBundle/Entity/CStudentPublication.php index ba124aacf6..a66dc7030e 100644 --- a/src/CourseBundle/Entity/CStudentPublication.php +++ b/src/CourseBundle/Entity/CStudentPublication.php @@ -34,6 +34,13 @@ class CStudentPublication extends AbstractResource implements ResourceInterface */ protected $iid; + /** + * @var string + * @Assert\NotBlank() + * @ORM\Column(name="title", type="string", length=255, nullable=true) + */ + protected $title; + /** * @var int * @@ -55,13 +62,6 @@ class CStudentPublication extends AbstractResource implements ResourceInterface */ protected $urlCorrection; - /** - * @var string - * @Assert\NotBlank() - * @ORM\Column(name="title", type="string", length=255, nullable=true) - */ - protected $title; - /** * @var string * diff --git a/src/CourseBundle/Entity/CThematic.php b/src/CourseBundle/Entity/CThematic.php index 4a67d05f48..ea58e3fb6d 100644 --- a/src/CourseBundle/Entity/CThematic.php +++ b/src/CourseBundle/Entity/CThematic.php @@ -42,7 +42,9 @@ class CThematic extends AbstractResource implements ResourceInterface /** * @var string + * * @Assert\NotBlank() + * * @ORM\Column(name="title", type="text", nullable=false) */ protected $title; diff --git a/src/CourseBundle/Entity/CThematicPlan.php b/src/CourseBundle/Entity/CThematicPlan.php index a94e77f173..5aecf3170d 100644 --- a/src/CourseBundle/Entity/CThematicPlan.php +++ b/src/CourseBundle/Entity/CThematicPlan.php @@ -7,6 +7,7 @@ namespace Chamilo\CourseBundle\Entity; use Chamilo\CoreBundle\Entity\AbstractResource; use Chamilo\CoreBundle\Entity\ResourceInterface; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; /** * CThematicPlan. @@ -31,6 +32,15 @@ class CThematicPlan extends AbstractResource implements ResourceInterface */ protected $iid; + /** + * @var string + * + * @Assert\NotBlank() + * + * @ORM\Column(name="title", type="string", length=255, nullable=false) + */ + protected $title; + /** * @var int * @@ -46,13 +56,6 @@ class CThematicPlan extends AbstractResource implements ResourceInterface */ protected $thematic; - /** - * @var string - * - * @ORM\Column(name="title", type="string", length=255, nullable=false) - */ - protected $title; - /** * @var string * diff --git a/src/CourseBundle/Entity/CWiki.php b/src/CourseBundle/Entity/CWiki.php index ac7c717f5b..1b9081d2ee 100644 --- a/src/CourseBundle/Entity/CWiki.php +++ b/src/CourseBundle/Entity/CWiki.php @@ -57,7 +57,9 @@ class CWiki /** * @var string + * * @Assert\NotBlank() + * * @ORM\Column(name="title", type="string", length=255, nullable=false) */ protected $title;