1- <?php declare (strict_types= 1 );
1+ <?php declare (strict_types = 1 );
22
33namespace App \Entity ;
44use Doctrine \ORM \Mapping as ORM ;
@@ -18,6 +18,12 @@ class SubEvent
1818 */
1919 protected $ id ;
2020
21+ /**
22+ * @var Event
23+ *
24+ * @ORM\ManyToOne(targetEntity="Event")
25+ */
26+ protected $ parent ;
2127
2228 /**
2329 * @var string
@@ -29,31 +35,78 @@ class SubEvent
2935 /**
3036 * @var string
3137 *
32- * @ORM\Column(type="string ")
38+ * @ORM\Column(type="text ")
3339 */
3440 protected $ description ;
3541
36-
37-
38- /**
39- * ItemType constructor
42+ /**
43+ * @var \DateTime
4044 *
45+ * @ORM\Column(type="datetimetz")
4146 */
47+ protected $ startDate ;
48+
4249 public function __construct () {
4350 $ this ->id = Uuid::uuid4 ();
4451 }
4552
4653 /**
47- * @return string
54+ * @var \DateTime
55+ *
56+ * @ORM\Column(type="datetimetz")
4857 */
58+ protected $ endDate ;
59+
60+ public function __construct (Event $ parent , string $ title , string $ description , \DateTime $ startDate , \DateTime $ endDate ) {
61+ $ this ->id = Uuid::uuid4 ();
62+ $ this ->parent = $ parent ;
63+ $ this ->title = $ title ;
64+ $ this ->description = $ description ;
65+ $ this ->startDate = $ startDate ;
66+ $ this ->endDate = $ endDate ;
67+ }
68+
69+ public function getId (): UuidInterface {
70+ return $ this ->id ;
71+ }
72+
73+ public function getParent (): Event {
74+ return $ this ->parent ;
75+ }
76+
77+ public function setParent (Event $ parent ): void {
78+ $ this ->parent = $ parent ;
79+ }
80+
4981 public function getTitle (): string {
5082 return $ this ->title ;
5183 }
5284
53- /**
54- * @param string $title
55- */
5685 public function setTitle (string $ title ): void {
5786 $ this ->title = $ title ;
5887 }
88+
89+ public function getDescription (): string {
90+ return $ this ->description ;
91+ }
92+
93+ public function setDescription (string $ description ): void {
94+ $ this ->description = $ description ;
95+ }
96+
97+ public function getStartDate (): \DateTime {
98+ return $ this ->startDate ;
99+ }
100+
101+ public function setStartDate (\DateTime $ startDate ): void {
102+ $ this ->startDate = $ startDate ;
103+ }
104+
105+ public function getEndDate (): \DateTime {
106+ return $ this ->endDate ;
107+ }
108+
109+ public function setEndDate (\DateTime $ endDate ): void {
110+ $ this ->endDate = $ endDate ;
111+ }
59112}
0 commit comments