Completed
Push — master ( c37a1b...043479 )
by Serhii
11s
created

Venue   A

Complexity

Total Complexity 20

Size/Duplication

Total Lines 271
Duplicated Lines 0 %

Coupling/Cohesion

Components 4
Dependencies 4

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 271
rs 10
wmc 20
lcom 4
cbo 4

20 Methods

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