zend-blog-3-backend

Форк
0
/
GeoLocationCity.php 
294 строки · 4.6 Кб
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: morontt
5
 * Date: 13.11.16
6
 * Time: 14:27
7
 */
8

9
namespace App\Entity;
10

11
use DateTime;
12
use 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
 */
20
class GeoLocationCity
21
{
22
    /**
23
     * @var int
24
     *
25
     * @ORM\Id
26
     * @ORM\Column(type="integer")
27
     * @ORM\GeneratedValue(strategy="AUTO")
28
     */
29
    protected $id;
30

31
    /**
32
     * @var string
33
     *
34
     * @ORM\Column(type="string", length=128)
35
     */
36
    protected $city;
37

38
    /**
39
     * @var string
40
     *
41
     * @ORM\Column(type="string", length=128)
42
     */
43
    protected $region;
44

45
    /**
46
     * @var float|null
47
     *
48
     * @ORM\Column(type="float", nullable=true)
49
     */
50
    protected $latitude;
51

52
    /**
53
     * @var float|null
54
     *
55
     * @ORM\Column(type="float", nullable=true)
56
     */
57
    protected $longitude;
58

59
    /**
60
     * @var string|null
61
     *
62
     * @ORM\Column(type="string", length=30, nullable=true)
63
     */
64
    protected $zip;
65

66
    /**
67
     * @var string|null
68
     *
69
     * @ORM\Column(type="string", length=8, nullable=true)
70
     */
71
    protected $timeZone;
72

73
    /**
74
     * @var GeoLocationCountry
75
     *
76
     * @ORM\ManyToOne(targetEntity="GeoLocationCountry")
77
     * @ORM\JoinColumn(nullable=false, onDelete="RESTRICT")
78
     */
79
    protected $country;
80

81
    /**
82
     * @var DateTime
83
     *
84
     * @ORM\Column(type="milliseconds_dt")
85
     */
86
    protected $timeCreated;
87

88
    public function __construct()
89
    {
90
        $this->timeCreated = new DateTime();
91
    }
92

93
    /**
94
     * Get id
95
     *
96
     * @return int
97
     */
98
    public function getId()
99
    {
100
        return $this->id;
101
    }
102

103
    /**
104
     * Set city
105
     *
106
     * @param string $city
107
     *
108
     * @return GeoLocationCity
109
     */
110
    public function setCity($city)
111
    {
112
        $this->city = $city;
113

114
        return $this;
115
    }
116

117
    /**
118
     * Get city
119
     *
120
     * @return string
121
     */
122
    public function getCity()
123
    {
124
        return $this->city;
125
    }
126

127
    /**
128
     * Set region
129
     *
130
     * @param string $region
131
     *
132
     * @return GeoLocationCity
133
     */
134
    public function setRegion($region)
135
    {
136
        $this->region = $region;
137

138
        return $this;
139
    }
140

141
    /**
142
     * Get region
143
     *
144
     * @return string
145
     */
146
    public function getRegion()
147
    {
148
        return $this->region;
149
    }
150

151
    /**
152
     * Set latitude
153
     *
154
     * @param float $latitude
155
     *
156
     * @return GeoLocationCity
157
     */
158
    public function setLatitude($latitude)
159
    {
160
        $this->latitude = $latitude;
161

162
        return $this;
163
    }
164

165
    /**
166
     * Get latitude
167
     *
168
     * @return float
169
     */
170
    public function getLatitude()
171
    {
172
        return $this->latitude;
173
    }
174

175
    /**
176
     * Set longitude
177
     *
178
     * @param float $longitude
179
     *
180
     * @return GeoLocationCity
181
     */
182
    public function setLongitude($longitude)
183
    {
184
        $this->longitude = $longitude;
185

186
        return $this;
187
    }
188

189
    /**
190
     * Get longitude
191
     *
192
     * @return float
193
     */
194
    public function getLongitude()
195
    {
196
        return $this->longitude;
197
    }
198

199
    /**
200
     * Set zip
201
     *
202
     * @param string $zip
203
     *
204
     * @return GeoLocationCity
205
     */
206
    public function setZip($zip)
207
    {
208
        $this->zip = $zip;
209

210
        return $this;
211
    }
212

213
    /**
214
     * Get zip
215
     *
216
     * @return string
217
     */
218
    public function getZip()
219
    {
220
        return $this->zip;
221
    }
222

223
    /**
224
     * Set timeZone
225
     *
226
     * @param string $timeZone
227
     *
228
     * @return GeoLocationCity
229
     */
230
    public function setTimeZone($timeZone)
231
    {
232
        $this->timeZone = $timeZone;
233

234
        return $this;
235
    }
236

237
    /**
238
     * Get timeZone
239
     *
240
     * @return string
241
     */
242
    public function getTimeZone()
243
    {
244
        return $this->timeZone;
245
    }
246

247
    /**
248
     * Set country
249
     *
250
     * @param GeoLocationCountry $country
251
     *
252
     * @return GeoLocationCity
253
     */
254
    public function setCountry(GeoLocationCountry $country)
255
    {
256
        $this->country = $country;
257

258
        return $this;
259
    }
260

261
    /**
262
     * Get country
263
     *
264
     * @return GeoLocationCountry
265
     */
266
    public function getCountry()
267
    {
268
        return $this->country;
269
    }
270

271
    /**
272
     * Set timeCreated
273
     *
274
     * @param DateTime $timeCreated
275
     *
276
     * @return GeoLocationCity
277
     */
278
    public function setTimeCreated($timeCreated)
279
    {
280
        $this->timeCreated = $timeCreated;
281

282
        return $this;
283
    }
284

285
    /**
286
     * Get timeCreated
287
     *
288
     * @return DateTime
289
     */
290
    public function getTimeCreated()
291
    {
292
        return $this->timeCreated;
293
    }
294
}
295

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.