zend-blog-3-backend
294 строки · 4.6 Кб
1<?php
2/**
3* Created by PhpStorm.
4* User: morontt
5* Date: 13.11.16
6* Time: 14:27
7*/
8
9namespace App\Entity;
10
11use DateTime;
12use Doctrine\ORM\Mapping as ORM;
13
14/**
15* @ORM\Table(uniqueConstraints={
16* @ORM\UniqueConstraint(columns={"city", "region", "country_id"})
17* })
18* @ORM\Entity(repositoryClass="App\Repository\GeoLocationCityRepository")
19*/
20class GeoLocationCity
21{
22/**
23* @var int
24*
25* @ORM\Id
26* @ORM\Column(type="integer")
27* @ORM\GeneratedValue(strategy="AUTO")
28*/
29protected $id;
30
31/**
32* @var string
33*
34* @ORM\Column(type="string", length=128)
35*/
36protected $city;
37
38/**
39* @var string
40*
41* @ORM\Column(type="string", length=128)
42*/
43protected $region;
44
45/**
46* @var float|null
47*
48* @ORM\Column(type="float", nullable=true)
49*/
50protected $latitude;
51
52/**
53* @var float|null
54*
55* @ORM\Column(type="float", nullable=true)
56*/
57protected $longitude;
58
59/**
60* @var string|null
61*
62* @ORM\Column(type="string", length=30, nullable=true)
63*/
64protected $zip;
65
66/**
67* @var string|null
68*
69* @ORM\Column(type="string", length=8, nullable=true)
70*/
71protected $timeZone;
72
73/**
74* @var GeoLocationCountry
75*
76* @ORM\ManyToOne(targetEntity="GeoLocationCountry")
77* @ORM\JoinColumn(nullable=false, onDelete="RESTRICT")
78*/
79protected $country;
80
81/**
82* @var DateTime
83*
84* @ORM\Column(type="milliseconds_dt")
85*/
86protected $timeCreated;
87
88public function __construct()
89{
90$this->timeCreated = new DateTime();
91}
92
93/**
94* Get id
95*
96* @return int
97*/
98public function getId()
99{
100return $this->id;
101}
102
103/**
104* Set city
105*
106* @param string $city
107*
108* @return GeoLocationCity
109*/
110public function setCity($city)
111{
112$this->city = $city;
113
114return $this;
115}
116
117/**
118* Get city
119*
120* @return string
121*/
122public function getCity()
123{
124return $this->city;
125}
126
127/**
128* Set region
129*
130* @param string $region
131*
132* @return GeoLocationCity
133*/
134public function setRegion($region)
135{
136$this->region = $region;
137
138return $this;
139}
140
141/**
142* Get region
143*
144* @return string
145*/
146public function getRegion()
147{
148return $this->region;
149}
150
151/**
152* Set latitude
153*
154* @param float $latitude
155*
156* @return GeoLocationCity
157*/
158public function setLatitude($latitude)
159{
160$this->latitude = $latitude;
161
162return $this;
163}
164
165/**
166* Get latitude
167*
168* @return float
169*/
170public function getLatitude()
171{
172return $this->latitude;
173}
174
175/**
176* Set longitude
177*
178* @param float $longitude
179*
180* @return GeoLocationCity
181*/
182public function setLongitude($longitude)
183{
184$this->longitude = $longitude;
185
186return $this;
187}
188
189/**
190* Get longitude
191*
192* @return float
193*/
194public function getLongitude()
195{
196return $this->longitude;
197}
198
199/**
200* Set zip
201*
202* @param string $zip
203*
204* @return GeoLocationCity
205*/
206public function setZip($zip)
207{
208$this->zip = $zip;
209
210return $this;
211}
212
213/**
214* Get zip
215*
216* @return string
217*/
218public function getZip()
219{
220return $this->zip;
221}
222
223/**
224* Set timeZone
225*
226* @param string $timeZone
227*
228* @return GeoLocationCity
229*/
230public function setTimeZone($timeZone)
231{
232$this->timeZone = $timeZone;
233
234return $this;
235}
236
237/**
238* Get timeZone
239*
240* @return string
241*/
242public function getTimeZone()
243{
244return $this->timeZone;
245}
246
247/**
248* Set country
249*
250* @param GeoLocationCountry $country
251*
252* @return GeoLocationCity
253*/
254public function setCountry(GeoLocationCountry $country)
255{
256$this->country = $country;
257
258return $this;
259}
260
261/**
262* Get country
263*
264* @return GeoLocationCountry
265*/
266public function getCountry()
267{
268return $this->country;
269}
270
271/**
272* Set timeCreated
273*
274* @param DateTime $timeCreated
275*
276* @return GeoLocationCity
277*/
278public function setTimeCreated($timeCreated)
279{
280$this->timeCreated = $timeCreated;
281
282return $this;
283}
284
285/**
286* Get timeCreated
287*
288* @return DateTime
289*/
290public function getTimeCreated()
291{
292return $this->timeCreated;
293}
294}
295