|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* YAWIK |
|
4
|
|
|
* |
|
5
|
|
|
* @filesource |
|
6
|
|
|
* @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de) |
|
7
|
|
|
* @license MIT |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace Core\Entity; |
|
11
|
|
|
|
|
12
|
|
|
use GeoJson\GeoJson; |
|
13
|
|
|
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; |
|
14
|
|
|
|
|
15
|
|
|
abstract class AbstractLocation extends AbstractEntity implements LocationInterface |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* city name of a job location |
|
19
|
|
|
* |
|
20
|
|
|
* @ODM\Field(type="string") |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $city; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* region of a job location. E.g "Hessen" is a region in germany |
|
26
|
|
|
* |
|
27
|
|
|
* @ODM\Field(type="string") |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $region; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* postalcode of a job location. |
|
33
|
|
|
* |
|
34
|
|
|
* @var String |
|
35
|
|
|
* @ODM\Field(type="string") |
|
36
|
|
|
*/ |
|
37
|
|
|
protected $postalcode; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* coordinates of a job location. |
|
41
|
|
|
* |
|
42
|
|
|
* @var GeoJson |
|
43
|
|
|
* @ODM\EmbedOne(discriminatorField="_entity") |
|
44
|
|
|
*/ |
|
45
|
|
|
protected $coordinates; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Country of a job location |
|
49
|
|
|
* @var String |
|
50
|
|
|
* |
|
51
|
|
|
* @ODM\Field(type="string") |
|
52
|
|
|
*/ |
|
53
|
|
|
protected $country; |
|
54
|
|
|
|
|
55
|
|
|
public function __construct() |
|
56
|
|
|
{ |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function preUpdate() |
|
60
|
|
|
{ |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function getCoordinates() |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->coordinates; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @param GeoJson $coordinates |
|
70
|
|
|
* |
|
71
|
|
|
* @return $this |
|
72
|
|
|
*/ |
|
73
|
|
|
public function setCoordinates(GeoJson $coordinates) |
|
74
|
|
|
{ |
|
75
|
|
|
$this->coordinates = $coordinates; |
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @return String |
|
81
|
|
|
*/ |
|
82
|
|
|
public function getPostalCode() |
|
83
|
|
|
{ |
|
84
|
|
|
return $this->postalcode; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
/** |
|
88
|
|
|
* @param $postalcode |
|
89
|
|
|
* |
|
90
|
|
|
* @return $this |
|
91
|
|
|
*/ |
|
92
|
|
|
public function setPostalCode($postalcode) |
|
93
|
|
|
{ |
|
94
|
|
|
$this->postalcode = $postalcode; |
|
95
|
|
|
return $this; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @return mixed |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getCity() |
|
102
|
|
|
{ |
|
103
|
|
|
return $this->city; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @param $country |
|
108
|
|
|
* |
|
109
|
|
|
* @return $this |
|
110
|
|
|
*/ |
|
111
|
|
|
public function setCity($country) |
|
112
|
|
|
{ |
|
113
|
|
|
$this->city = $country; |
|
114
|
|
|
return $this; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
/** |
|
118
|
|
|
* @return String |
|
119
|
|
|
*/ |
|
120
|
|
|
public function getCountry() |
|
121
|
|
|
{ |
|
122
|
|
|
return $this->country; |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
/** |
|
126
|
|
|
* @param $country |
|
127
|
|
|
* |
|
128
|
|
|
* @return $this |
|
129
|
|
|
*/ |
|
130
|
|
|
public function setCountry($country) |
|
131
|
|
|
{ |
|
132
|
|
|
$this->country = $country; |
|
133
|
|
|
return $this; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* @return mixed |
|
138
|
|
|
*/ |
|
139
|
|
|
public function getRegion() |
|
140
|
|
|
{ |
|
141
|
|
|
return $this->region; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* @param $region |
|
146
|
|
|
* |
|
147
|
|
|
* @return $this |
|
148
|
|
|
*/ |
|
149
|
|
|
public function setRegion($region) |
|
150
|
|
|
{ |
|
151
|
|
|
$this->region = $region; |
|
152
|
|
|
return $this; |
|
153
|
|
|
} |
|
154
|
|
|
} |