diff --git a/src/Entity/Event.php b/src/Entity/Event.php index fcb1030..1fd7769 100644 --- a/src/Entity/Event.php +++ b/src/Entity/Event.php @@ -29,7 +29,7 @@ class Event /** * @var string * - * @ORM\Column(type="string") + * @ORM\Column(type="text") */ protected $description; @@ -39,39 +39,28 @@ class Event */ protected $eventType; - - /** - * ItemType constructor - * - */ - public function __construct() { + public function __construct(string $title, EventType $eventType) { $this->id = Uuid::uuid4(); + $this->title = $title; + $this->eventType = $eventType; + } + + public function getId(): UuidInterface { + return $this->id; } - /** - * @return string - */ public function getTitle(): string { return $this->title; } - /** - * @param string $title - */ public function setTitle(string $title): void { $this->title = $title; } - /** - * @return EventType - */ public function getEventType(): EventType { return $this->eventType; } - /** - * @param EventType $eventType - */ public function setEventType(EventType $eventType): void { $this->eventType = $eventType; } diff --git a/src/Entity/EventType.php b/src/Entity/EventType.php index 4a3123c..ceba819 100644 --- a/src/Entity/EventType.php +++ b/src/Entity/EventType.php @@ -1,4 +1,4 @@ -name = $name; + $this->comment = $comment; + } + + public function getId(): int { + return $this->id; } - /** - * @return string - */ public function getName(): string { return $this->name; } - /** - * @param string $name - */ public function setName(string $name): void { $this->name = $name; } - /** - * @return null|string - */ public function getComment(): ?string { return $this->comment; } - /** - * @param null|string $comment - */ public function setComment(?string $comment): void { $this->comment = $comment; } diff --git a/src/Entity/SubEvent.php b/src/Entity/SubEvent.php index f246ead..37a587b 100644 --- a/src/Entity/SubEvent.php +++ b/src/Entity/SubEvent.php @@ -1,4 +1,4 @@ -id = Uuid::uuid4(); } /** - * @return string + * @var \DateTime + * + * @ORM\Column(type="datetimetz") */ + protected $endDate; + + public function __construct(Event $parent, string $title, string $description, \DateTime $startDate, \DateTime $endDate) { + $this->id = Uuid::uuid4(); + $this->parent = $parent; + $this->title = $title; + $this->description = $description; + $this->startDate = $startDate; + $this->endDate = $endDate; + } + + public function getId(): UuidInterface { + return $this->id; + } + + public function getParent(): Event { + return $this->parent; + } + + public function setParent(Event $parent): void { + $this->parent = $parent; + } + public function getTitle(): string { return $this->title; } - /** - * @param string $title - */ public function setTitle(string $title): void { $this->title = $title; } + + public function getDescription(): string { + return $this->description; + } + + public function setDescription(string $description): void { + $this->description = $description; + } + + public function getStartDate(): \DateTime { + return $this->startDate; + } + + public function setStartDate(\DateTime $startDate): void { + $this->startDate = $startDate; + } + + public function getEndDate(): \DateTime { + return $this->endDate; + } + + public function setEndDate(\DateTime $endDate): void { + $this->endDate = $endDate; + } }