1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Starkerxp\CampagneBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Starkerxp\StructureBundle\Entity\UtilisateurEntity; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Template. |
10
|
|
|
* |
11
|
|
|
* @ORM\Table(name="template") |
12
|
|
|
* @ORM\Entity(repositoryClass="Starkerxp\CampagneBundle\Repository\TemplateRepository") |
13
|
|
|
*/ |
14
|
|
|
class Template extends UtilisateurEntity |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @var int |
18
|
|
|
* |
19
|
|
|
* @ORM\Column(name="id", type="integer") |
20
|
|
|
* @ORM\Id |
21
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
22
|
|
|
*/ |
23
|
|
|
protected $id; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var string |
27
|
|
|
* |
28
|
|
|
* @ORM\Column(name="name", type="string", length=255) |
29
|
|
|
*/ |
30
|
|
|
protected $nom; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @var string |
34
|
|
|
* |
35
|
|
|
* @ORM\Column(name="type", type="string", length=255) |
36
|
|
|
*/ |
37
|
|
|
protected $type; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
* |
42
|
|
|
* @ORM\Column(name="object", type="string", length=255) |
43
|
|
|
*/ |
44
|
|
|
protected $sujet; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @var string |
48
|
|
|
* |
49
|
|
|
* @ORM\Column(name="message", type="text") |
50
|
|
|
*/ |
51
|
|
|
protected $message; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @ORM\OneToMany( |
55
|
|
|
* targetEntity="Event", |
56
|
|
|
* mappedBy="template" |
57
|
|
|
* ) |
58
|
|
|
*/ |
59
|
|
|
protected $events; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get id. |
63
|
|
|
* |
64
|
|
|
* @return int |
65
|
|
|
*/ |
66
|
|
|
public function getId() |
67
|
|
|
{ |
68
|
|
|
return $this->id; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
|
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* Get nom. |
75
|
|
|
* |
76
|
|
|
* @return string |
77
|
|
|
*/ |
78
|
|
|
public function getNom() |
79
|
|
|
{ |
80
|
|
|
return $this->nom; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Set nom. |
85
|
|
|
* |
86
|
|
|
* @param string $nom |
87
|
|
|
* |
88
|
|
|
*/ |
89
|
|
|
public function setNom($nom) |
90
|
|
|
{ |
91
|
|
|
$this->nom = $nom; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Get type. |
96
|
|
|
* |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
|
|
public function getType() |
100
|
|
|
{ |
101
|
|
|
return $this->type; |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Set type. |
106
|
|
|
* |
107
|
|
|
* @param string $type |
108
|
|
|
* |
109
|
|
|
*/ |
110
|
|
|
public function setType($type) |
111
|
|
|
{ |
112
|
|
|
$this->type = $type; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Get sujet. |
117
|
|
|
* |
118
|
|
|
* @return string |
119
|
|
|
*/ |
120
|
|
|
public function getSujet() |
121
|
|
|
{ |
122
|
|
|
return $this->sujet; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Set sujet. |
127
|
|
|
* |
128
|
|
|
* @param string $sujet |
129
|
|
|
* |
130
|
|
|
*/ |
131
|
|
|
public function setSujet($sujet) |
132
|
|
|
{ |
133
|
|
|
$this->sujet = $sujet; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Get message. |
138
|
|
|
* |
139
|
|
|
* @return string |
140
|
|
|
*/ |
141
|
|
|
public function getMessage() |
142
|
|
|
{ |
143
|
|
|
return $this->message; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Set message. |
148
|
|
|
* |
149
|
|
|
* @param string $message |
150
|
|
|
* |
151
|
|
|
*/ |
152
|
|
|
public function setMessage($message) |
153
|
|
|
{ |
154
|
|
|
$this->message = $message; |
155
|
|
|
} |
156
|
|
|
|
157
|
|
|
/** |
158
|
|
|
* Constructor |
159
|
|
|
*/ |
160
|
|
|
public function __construct() |
161
|
|
|
{ |
162
|
|
|
$this->events = new \Doctrine\Common\Collections\ArrayCollection(); |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Add event |
167
|
|
|
* |
168
|
|
|
* @param \Starkerxp\CampagneBundle\Entity\Event $event |
169
|
|
|
* |
170
|
|
|
* @return Template |
171
|
|
|
*/ |
172
|
|
|
public function addEvent(\Starkerxp\CampagneBundle\Entity\Event $event) |
173
|
|
|
{ |
174
|
|
|
$this->events[] = $event; |
175
|
|
|
|
176
|
|
|
return $this; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* Remove event |
181
|
|
|
* |
182
|
|
|
* @param \Starkerxp\CampagneBundle\Entity\Event $event |
183
|
|
|
*/ |
184
|
|
|
public function removeEvent(\Starkerxp\CampagneBundle\Entity\Event $event) |
185
|
|
|
{ |
186
|
|
|
$this->events->removeElement($event); |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* Get events |
191
|
|
|
* |
192
|
|
|
* @return \Doctrine\Common\Collections\Collection |
193
|
|
|
*/ |
194
|
|
|
public function getEvents() |
195
|
|
|
{ |
196
|
|
|
return $this->events; |
197
|
|
|
} |
198
|
|
|
} |
|
|
|
|
199
|
|
|
|
This check marks files that end in a newline character, i.e. an empy line.