Completed
Pull Request — master (#136)
by
unknown
15:29
created

PriceCategory::getPlaces()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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