Completed
Pull Request — master (#136)
by
unknown
13:00
created

PriceCategory::getVenueSector()   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
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
use Gedmo\Translatable\Document\Translation;
9
use JMS\Serializer\Annotation as Serializer;
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="price_category")
19
 * @ORM\Entity(repositoryClass="AppBundle\Repository\PriceCategoryRepository")
20
 * @Gedmo\TranslationEntity(class="AppBundle\Entity\Translations\PriceCategoryTranslation")
21
 * @ExclusionPolicy("all")
22
 */
23
class PriceCategory 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
     * @Assert\NotBlank()
37
     * @ORM\Column(type="string", length=255)
38
     * @Serializer\Groups({"get_ticket"})
39
     * @Type("string")
40
     * @Expose()
41
     */
42
    protected $rows;
43
44
    /**
45
     * @var string
46
     * @Assert\NotBlank()
47
     * @ORM\Column(type="string", length=255)
48
     * @Type("string")
49
     * @Serializer\Groups({"get_ticket"})
50
     * @Expose()
51
     */
52
    protected $places;
53
    /**
54
     * @var string
55
     * @Assert\NotBlank()
56
     * @ORM\Column(type="string", length=255, options={"default" : "grey"})
57
     * @Type("string")
58
     * @Expose()
59
     */
60
    protected $color;
61
62
    /**
63
     * @var integer
64
     * @Assert\NotBlank()
65
     * @ORM\Column(type="integer")
66
     * @Type("integer")
67
     * @Expose()
68
     */
69
    protected $price;
70
71
    /**
72
     * @var ArrayCollection|Translation[]
73
     *
74
     * @ORM\OneToMany(
75
     *     targetEntity="AppBundle\Entity\Translations\PriceCategoryTranslation",
76
     *     mappedBy="object",
77
     *     cascade={"persist", "remove"}
78
     * )
79
     */
80
    protected $translations;
81
82
    /**
83
     * @var PerformanceEvent
84
     *
85
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PerformanceEvent", inversedBy="priceCategories")
86
     * @Type("AppBundle\Entity\PerformanceEvent")
87
     * @Expose()
88
     */
89
    protected $performanceEvent;
90
91
    /**
92
     * @var VenueSector
93
     *
94
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\VenueSector", inversedBy="priceCategories")
95
     * @Type("AppBundle\Entity\VenueSector")
96
     * @Expose()
97
     */
98
    protected $venueSector;
99
100
    /**
101
     * @return integer
102
     */
103
    public function getId()
104
    {
105
        return $this->id;
106
    }
107
108
    /**
109
     * @return PriceCategory
110
     */
111
    public function unsetTranslations()
112
    {
113
        $this->translations = null;
114
115
        return $this;
116
    }
117
118
    /**
119
     * @param  string $color
120
     * @return PriceCategory
121
     */
122
    public function setColor($color = 'grey')
123
    {
124
        $this->color = $color;
125
126
        return $this;
127
    }
128
129
    /**
130
     * @return string
131
     */
132
    public function getColor()
133
    {
134
        return $this->color;
135
    }
136
137
    /**
138
     * @return VenueSector
139
     */
140
    public function getVenueSector()
141
    {
142
        return $this->venueSector;
143
    }
144
145
    /**
146
     * @param VenueSector $venueSector
147
     */
148
    public function setVenueSector(VenueSector $venueSector)
149
    {
150
        $this->venueSector = $venueSector;
151
    }
152
153
    /**
154
     * @return string
155
     */
156
    public function getRows()
157
    {
158
        return $this->rows;
159
    }
160
161
    /**
162
     * @param string $rows
163
     */
164
    public function setRows(string $rows)
165
    {
166
        $this->rows = $rows;
167
    }
168
169
    /**
170
     * @return string
171
     */
172
    public function getPlaces()
173
    {
174
        return $this->places;
175
    }
176
177
    /**
178
     * @param string $places
179
     */
180
    public function setPlaces(string $places)
181
    {
182
        $this->places = $places;
183
    }
184
185
    /**
186
     * @return int
187
     */
188
    public function getPrice()
189
    {
190
        return $this->price;
191
    }
192
193
    /**
194
     * @param int $price
195
     */
196
    public function setPrice(int $price)
197
    {
198
        $this->price = $price;
199
    }
200
201
    /**
202
     * @return PerformanceEvent
203
     */
204
    public function getPerformanceEvent()
205
    {
206
        return $this->performanceEvent;
207
    }
208
209
    /**
210
     * @param PerformanceEvent $performanceEvent
211
     */
212
    public function setPerformanceEvent(PerformanceEvent $performanceEvent)
213
    {
214
        $this->performanceEvent = $performanceEvent;
215
    }
216
}
217