Completed
Pull Request — master (#136)
by
unknown
11:23
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
     * @ORM\Column(type="string", length=255)
47
     * @Type("string")
48
     * @Serializer\Groups({"get_ticket"})
49
     * @Expose()
50
     */
51
    protected $places;
52
    /**
53
     * @var string
54
     * @Assert\NotBlank()
55
     * @ORM\Column(type="string", length=255, options={"default" : "grey"})
56
     * @Type("string")
57
     * @Expose()
58
     */
59
    protected $color;
60
61
    /**
62
     * @var integer
63
     * @Assert\NotBlank()
64
     * @ORM\Column(type="integer", nullable=false)
65
     * @Type("integer")
66
     * @Expose()
67
     */
68
    protected $price;
69
70
    /**
71
     * @var ArrayCollection|Translation[]
72
     *
73
     * @ORM\OneToMany(
74
     *     targetEntity="AppBundle\Entity\Translations\PriceCategoryTranslation",
75
     *     mappedBy="object",
76
     *     cascade={"persist", "remove"}
77
     * )
78
     */
79
    protected $translations;
80
81
    /**
82
     * @var PerformanceEvent
83
     *
84
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PerformanceEvent", inversedBy="priceCategories")
85
     * @Type("AppBundle\Entity\PerformanceEvent")
86
     * @Expose()
87
     */
88
    protected $performanceEvent;
89
90
    /**
91
     * @var VenueSector
92
     *
93
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\VenueSector", inversedBy="priceCategories")
94
     * @Type("AppBundle\Entity\VenueSector")
95
     * @Expose()
96
     */
97
    protected $venueSector;
98
99
    /**
100
     * @return integer
101
     */
102
    public function getId()
103
    {
104
        return $this->id;
105
    }
106
107
    /**
108
     * @return PriceCategory
109
     */
110
    public function unsetTranslations()
111
    {
112
        $this->translations = null;
113
114
        return $this;
115
    }
116
117
    /**
118
     * @param  string $color
119
     * @return PriceCategory
120
     */
121
    public function setColor($color = 'grey')
122
    {
123
        $this->color = $color;
124
125
        return $this;
126
    }
127
128
    /**
129
     * @return string
130
     */
131
    public function getColor()
132
    {
133
        return $this->color;
134
    }
135
136
    /**
137
     * @return VenueSector
138
     */
139
    public function getVenueSector()
140
    {
141
        return $this->venueSector;
142
    }
143
144
    /**
145
     * @param VenueSector $venueSector
146
     */
147
    public function setVenueSector(VenueSector $venueSector)
148
    {
149
        $this->venueSector = $venueSector;
150
    }
151
152
    /**
153
     * @return string
154
     */
155
    public function getRows()
156
    {
157
        return $this->rows;
158
    }
159
160
    /**
161
     * @param string $rows
162
     */
163
    public function setRows(string $rows)
164
    {
165
        $this->rows = $rows;
166
    }
167
168
    /**
169
     * @return string
170
     */
171
    public function getPlaces()
172
    {
173
        return $this->places;
174
    }
175
176
    /**
177
     * @param string $places
178
     */
179
    public function setPlaces(string $places)
180
    {
181
        $this->places = $places;
182
    }
183
184
    /**
185
     * @return int
186
     */
187
    public function getPrice()
188
    {
189
        return $this->price;
190
    }
191
192
    /**
193
     * @param int $price
194
     */
195
    public function setPrice(int $price)
196
    {
197
        $this->price = $price;
198
    }
199
200
    /**
201
     * @return PerformanceEvent
202
     */
203
    public function getPerformanceEvent()
204
    {
205
        return $this->performanceEvent;
206
    }
207
208
    /**
209
     * @param PerformanceEvent $performanceEvent
210
     */
211
    public function setPerformanceEvent(PerformanceEvent $performanceEvent)
212
    {
213
        $this->performanceEvent = $performanceEvent;
214
    }
215
}
216