1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace App\Entity\Traits; |
6
|
|
|
|
7
|
|
|
use App\Entity\City; |
8
|
|
|
use App\Entity\District; |
9
|
|
|
use App\Entity\Metro; |
10
|
|
|
use App\Entity\Neighborhood; |
11
|
|
|
use Doctrine\ORM\Mapping as ORM; |
12
|
|
|
|
13
|
|
|
trait EntityLocationTrait |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\City", inversedBy="properties") |
17
|
|
|
* @ORM\JoinColumn(nullable=false) |
18
|
|
|
*/ |
19
|
|
|
private $city; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\District", inversedBy="properties") |
23
|
|
|
* @ORM\JoinColumn(nullable=true) |
24
|
|
|
*/ |
25
|
|
|
private $district; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Neighborhood", inversedBy="properties") |
29
|
|
|
* @ORM\JoinColumn(nullable=true) |
30
|
|
|
*/ |
31
|
|
|
private $neighborhood; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Metro", inversedBy="properties") |
35
|
|
|
* @ORM\JoinColumn(nullable=true) |
36
|
|
|
*/ |
37
|
|
|
private $metro_station; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @ORM\Column(type="string", length=255) |
41
|
|
|
*/ |
42
|
|
|
private $address; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @ORM\Column(type="string", length=255, nullable=true) |
46
|
|
|
*/ |
47
|
|
|
private $latitude; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @ORM\Column(type="string", length=255, nullable=true) |
51
|
|
|
*/ |
52
|
|
|
private $longitude; |
53
|
|
|
|
54
|
|
|
public function getCity(): ?City |
55
|
|
|
{ |
56
|
|
|
return $this->city; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setCity(?City $city): self |
60
|
|
|
{ |
61
|
|
|
$this->city = $city; |
62
|
|
|
|
63
|
|
|
return $this; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getDistrict(): ?District |
67
|
|
|
{ |
68
|
|
|
return $this->district; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function setDistrict(?District $district): self |
72
|
|
|
{ |
73
|
|
|
$this->district = $district; |
74
|
|
|
|
75
|
|
|
return $this; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
public function getNeighborhood(): ?Neighborhood |
79
|
|
|
{ |
80
|
|
|
return $this->neighborhood; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function setNeighborhood(?Neighborhood $neighborhood): self |
84
|
|
|
{ |
85
|
|
|
$this->neighborhood = $neighborhood; |
86
|
|
|
|
87
|
|
|
return $this; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
public function getMetroStation(): ?Metro |
91
|
|
|
{ |
92
|
|
|
return $this->metro_station; |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
public function setMetroStation(?Metro $metro_station): self |
96
|
|
|
{ |
97
|
|
|
$this->metro_station = $metro_station; |
98
|
|
|
|
99
|
|
|
return $this; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
public function getAddress(): ?string |
103
|
|
|
{ |
104
|
|
|
return $this->address; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
public function setAddress(string $address): self |
108
|
|
|
{ |
109
|
|
|
$this->address = $address; |
110
|
|
|
|
111
|
|
|
return $this; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
public function getLatitude(): ?string |
115
|
|
|
{ |
116
|
|
|
return $this->latitude; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
public function setLatitude(?string $latitude): self |
120
|
|
|
{ |
121
|
|
|
$this->latitude = $latitude; |
122
|
|
|
|
123
|
|
|
return $this; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function getLongitude(): ?string |
127
|
|
|
{ |
128
|
|
|
return $this->longitude; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
public function setLongitude(?string $longitude): self |
132
|
|
|
{ |
133
|
|
|
$this->longitude = $longitude; |
134
|
|
|
|
135
|
|
|
return $this; |
136
|
|
|
} |
137
|
|
|
} |
138
|
|
|
|