/
CalendarEventTemplate.php
113 lines (94 loc) · 2.11 KB
/
CalendarEventTemplate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
namespace Concrete\Core\Entity\Calendar\Summary;
use Concrete\Core\Entity\Summary\GetTemplateDataTrait;
use Concrete\Core\Entity\Summary\Template;
use Concrete\Core\Summary\Data\Collection;
use Concrete\Core\Summary\Template\RenderableTemplateInterface;
use Doctrine\ORM\Mapping as ORM;
/**
*
* @ORM\Entity
* @ORM\Table(
* name="CalendarEventSummaryTemplates"
* )
*/
class CalendarEventTemplate implements RenderableTemplateInterface
{
use GetTemplateDataTrait;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Concrete\Core\Entity\Calendar\CalendarEvent", inversedBy="summary_templates")
* @ORM\JoinColumn(name="eventID", referencedColumnName="eventID")
*/
protected $event;
/**
* @ORM\ManyToOne(targetEntity="Concrete\Core\Entity\Summary\Template")
*/
protected $template;
/**
* @ORM\Column(type="json")
*/
protected $data;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getEvent()
{
return $this->event;
}
/**
* @param mixed $event
*/
public function setEvent($event): void
{
$this->event = $event;
}
/**
* @return mixed
*/
public function getTemplate() : Template
{
return $this->template;
}
/**
* @param mixed $template
*/
public function setTemplate(Template $template): void
{
$this->template = $template;
}
public function getRawData()
{
return $this->data;
}
/**
* @param mixed $data
*/
public function setData($data): void
{
$this->data = $data;
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$data = [
'template' => $this->getTemplate(),
'data' => $this->getData(),
'id' => $this->getId(),
'eventID' => $this->getEvent()->getID(),
];
return $data;
}
}