Completed
Pull Request — master (#136)
by
unknown
12:23
created

Venue::setPriceCategories()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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
     * Venue constructor.
105
     */
106
    public function __construct()
107
    {
108
        parent::__construct();
109
        $this->performanceEvents = new ArrayCollection();
110
        $this->venueSectors = new ArrayCollection();
111
    }
112
113
    /**
114
     * @return integer
115
     */
116
    public function getId()
117
    {
118
        return $this->id;
119
    }
120
121
    /**
122
     * @return Venue
123
     */
124
    public function unsetTranslations()
125
    {
126
        $this->translations = null;
127
128
        return $this;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getTitle()
135
    {
136
        return $this->title;
137
    }
138
139
    /**
140
     * @param  string $title
141
     * @return Venue
142
     */
143
    public function setTitle($title)
144
    {
145
        $this->title = $title;
146
147
        return $this;
148
    }
149
150
    /**
151
     * @return string
152
     */
153
    public function getAddress()
154
    {
155
        return $this->address;
156
    }
157
158
    /**
159
     * @param  string $address
160
     * @return Venue
161
     */
162
    public function setAddress($address)
163
    {
164
        $this->address = $address;
165
166
        return $this;
167
    }
168
169
    /**
170
     * @return string
171
     */
172
    public function getHallTemplate()
173
    {
174
        return $this->hallTemplate;
175
    }
176
177
    /**
178
     * @param  string $hallTemplate
179
     * @return Venue
180
     */
181
    public function setHallTemplate($hallTemplate)
182
    {
183
        $this->hallTemplate = $hallTemplate;
184
185
        return $this;
186
    }
187
188
    /**
189
     * @param  PerformanceEvent $performanceEvent
190
     * @return Venue
191
     */
192
    public function addPerformanceEvent(PerformanceEvent $performanceEvent)
193
    {
194
        $this->performanceEvents[] = $performanceEvent;
195
196
        return $this;
197
    }
198
199
    /**
200
     * @param PerformanceEvent $performanceEvent
201
     */
202
    public function removePerformanceEvent(PerformanceEvent $performanceEvent)
203
    {
204
        $this->performanceEvents->removeElement($performanceEvent);
205
    }
206
207
    /**
208
     * @return Collection
209
     */
210
    public function getPerformanceEvents()
211
    {
212
        return $this->performanceEvents;
213
    }
214
215
    /**
216
     * @param  VenueSector $venueSector
217
     * @return Venue
218
     */
219
    public function addVenueSector(VenueSector $venueSector)
220
    {
221
        $this->venueSectors[] = $venueSector;
222
223
        return $this;
224
    }
225
226
    /**
227
     * @param VenueSector $venueSector
228
     */
229
    public function removeVenueSector(VenueSector $venueSector)
230
    {
231
        $this->venueSectors->removeElement($venueSector);
232
    }
233
234
    /**
235
     * @return Collection
236
     */
237
    public function getVenueSector()
238
    {
239
        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 239 which is incompatible with the return type documented by AppBundle\Entity\Venue::getVenueSector of type Doctrine\Common\Collections\Collection.
Loading history...
240
    }
241
242
    /**
243
     * @return string
244
     */
245
    public function __toString()
246
    {
247
        return $this->getTitle();
248
    }
249
}
250