Completed
Pull Request — master (#132)
by
unknown
08:35
created

Venue::setHallTemplate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use Doctrine\ORM\Mapping as ORM;
8
use Gedmo\Mapping\Annotation as Gedmo;
9
use Gedmo\Translatable\Document\Translation;
10
use JMS\Serializer\Annotation\ExclusionPolicy;
11
use JMS\Serializer\Annotation\Expose;
12
use JMS\Serializer\Annotation\Type;
13
use Sonata\TranslationBundle\Model\Gedmo\TranslatableInterface;
14
use Sonata\TranslationBundle\Model\Gedmo\AbstractPersonalTranslatable;
15
use Symfony\Component\Validator\Constraints as Assert;
16
17
/**
18
 * @ORM\Table(name="venue")
19
 * @ORM\Entity(repositoryClass="AppBundle\Repository\VenueRepository")
20
 * @Gedmo\TranslationEntity(class="AppBundle\Entity\Translations\VenueTranslation")
21
 * @ExclusionPolicy("all")
22
 */
23
class Venue extends AbstractPersonalTranslatable implements TranslatableInterface
24
{
25
    /**
26
     * @var integer
27
     *
28
     * @ORM\Column(name="id", type="integer")
29
     * @ORM\Id
30
     * @ORM\GeneratedValue(strategy="AUTO")
31
     */
32
    protected $id;
33
34
    /**
35
     * @var string
36
     * @Gedmo\Translatable
37
     * @Assert\NotBlank()
38
     * @ORM\Column(type="string", length=255)
39
     * @Type("string")
40
     * @Expose()
41
     */
42
    protected $title;
43
44
    /**
45
     * @var string
46
     * @Gedmo\Translatable
47
     * @Assert\NotBlank()
48
     * @ORM\Column(type="string", length=255)
49
     * @Type("string")
50
     * @Expose()
51
     */
52
    protected $address;
53
54
    /**
55
     * @var string
56
     * @Gedmo\Translatable
57
     * @Assert\NotBlank()
58
     * @ORM\Column(type="text", nullable=true)
59
     * @Type("string")
60
     * @Expose()
61
     */
62
    protected $hallTemplate;
63
64
    /**
65
     * @var ArrayCollection|Translation[]
66
     *
67
     * @ORM\OneToMany(
68
     *     targetEntity="AppBundle\Entity\Translations\VenueTranslation",
69
     *     mappedBy="object",
70
     *     cascade={"persist", "remove"}
71
     * )
72
     */
73
    protected $translations;
74
75
    /**
76
     * @var ArrayCollection|PerformanceEvent[]
77
     *
78
     * @ORM\OneToMany(
79
     *     targetEntity="AppBundle\Entity\PerformanceEvent",
80
     *     mappedBy="venue",
81
     *     cascade={"persist"},
82
     *     orphanRemoval=true
83
     * )
84
     */
85
    protected $performanceEvents;
86
87
    /**
88
     * @var ArrayCollection|VenueSector[]
89
     *
90
     * @ORM\OneToMany(
91
     *     targetEntity="AppBundle\Entity\VenueSector",
92
     *     mappedBy="object",
93
     *     cascade={"persist", "remove"}
94
     * )
95
     */
96
    protected $venueSector;
97
98
    /**
99
     * @var ArrayCollection|PriceCategory[]
100
     *
101
     * @ORM\OneToMany(
102
     *     targetEntity="AppBundle\Entity\PriceCategory",
103
     *     mappedBy="object",
104
     *     cascade={"persist", "remove"}
105
     * )
106
     */
107
    protected $priceCategory;
108
109
    /**
110
     * Venue constructor.
111
     */
112
    public function __construct()
113
    {
114
        parent::__construct();
115
        $this->performanceEvents = new ArrayCollection();
116
        $this->venueSector = new ArrayCollection();
117
        $this->priceCategory = new ArrayCollection();
118
    }
119
120
    /**
121
     * @return integer
122
     */
123
    public function getId()
124
    {
125
        return $this->id;
126
    }
127
128
    /**
129
     * @return Venue
130
     */
131 1
    public function unsetTranslations()
132
    {
133 1
        $this->translations = null;
134
135 1
        return $this;
136
    }
137
138
    /**
139
     * @return string
140
     */
141
    public function getTitle()
142
    {
143
        return $this->title;
144
    }
145
146
    /**
147
     * @param  string $title
148
     * @return Venue
149
     */
150
    public function setTitle($title)
151
    {
152
        $this->title = $title;
153
154
        return $this;
155
    }
156
157
    /**
158
     * @return string
159
     */
160
    public function getAddress()
161
    {
162
        return $this->address;
163
    }
164
165
    /**
166
     * @param  string $address
167
     * @return Venue
168
     */
169
    public function setAddress($address)
170
    {
171
        $this->address = $address;
172
173
        return $this;
174
    }
175
176
    /**
177
     * @return string
178
     */
179
    public function getHallTemplate()
180
    {
181
        return $this->hallTemplate;
182
    }
183
184
    /**
185
     * @param  string $hallTemplate
186
     * @return Venue
187
     */
188
    public function setHallTemplate($hallTemplate)
189
    {
190
        $this->hallTemplate = $hallTemplate;
191
192
        return $this;
193
    }
194
195
    /**
196
     * @param  PerformanceEvent $performanceEvent
197
     * @return Venue
198
     */
199
    public function addPerformanceEvent(PerformanceEvent $performanceEvent)
200
    {
201
        $this->performanceEvents[] = $performanceEvent;
202
203
        return $this;
204
    }
205
206
    /**
207
     * @param PerformanceEvent $performanceEvent
208
     */
209
    public function removePerformanceEvent(PerformanceEvent $performanceEvent)
210
    {
211
        $this->performanceEvents->removeElement($performanceEvent);
212
    }
213
214
    /**
215
     * @return Collection
216
     */
217
    public function getPerformanceEvents()
218
    {
219
        return $this->performanceEvents;
220
    }
221
222
    /**
223
     * @param  VenueSector $venueSector
224
     * @return Venue
225
     */
226
    public function addVenueSector(VenueSector $venueSector)
227
    {
228
        $this->venueSector[] = $venueSector;
229
230
        return $this;
231
    }
232
233
    /**
234
     * @param VenueSector $venueSector
235
     */
236
    public function removeVenueSector(VenueSector $venueSector)
237
    {
238
        $this->venueSector->removeElement($venueSector);
239
    }
240
241
    /**
242
     * @return Collection
243
     */
244
    public function getVenueSector()
245
    {
246
        return $this->venueSector;
247
    }
248
249
250
    /**
251
     * @param  PriceCategory $priceCategory
252
     * @return Venue
253
     */
254
    public function addPriceCategory(PriceCategory $priceCategory)
255
    {
256
        $this->priceCategory[] = $priceCategory;
257
258
        return $this;
259
    }
260
261
    /**
262
     * @param PriceCategory $priceCategory
263
     */
264
    public function removePriceCategory(PriceCategory $priceCategory)
265
    {
266
        $this->priceCategory->removeElement($priceCategory);
267
    }
268
269
    /**
270
     * @return Collection
271
     */
272
    public function getPriceCategory()
273
    {
274
        return $this->priceCategory;
275
    }
276
277
    /**
278
     * @return string
279
     */
280
    public function __toString()
281
    {
282
        return $this->getTitle();
283
    }
284
}
285