@@ 145-162 (lines=18) @@ | ||
142 | * |
|
143 | * @return string|false |
|
144 | */ |
|
145 | public function findFiasSettlement($city, $region_code, $first_letters = false, $strict_search = false, $full_settlements = false) |
|
146 | { |
|
147 | $this->geo = new GeoFixer(); |
|
148 | ||
149 | $this->geo->isStrict($strict_search); |
|
150 | $this->geo->isFirstLetters($first_letters); |
|
151 | $this->geo->isFullSettlements($full_settlements); |
|
152 | ||
153 | $result = $this->geo->findFiasSettlements($city, $region_code); |
|
154 | ||
155 | if ($result === false && $this->logger) { |
|
156 | $this->logger->warning('Не найден город ' . $city . ' в регионе с кодом ' . $region_code . ' базы ФИАС'); |
|
157 | $this->logger->warning('Строгий режим: ' . (int) $strict_search); |
|
158 | $this->logger->warning('Режим "совпадают первые буквы": ' . (int) $first_letters . PHP_EOL); |
|
159 | } |
|
160 | ||
161 | return $result; |
|
162 | } |
|
163 | ||
164 | /** |
|
165 | * Поиск ID городов, или ID городов и поселений по коду региона в базе КЛАДР |
|
@@ 207-223 (lines=17) @@ | ||
204 | * |
|
205 | * @return string|false |
|
206 | */ |
|
207 | public function findFiasStreet($street, $city_id, $first_letters = false, $strict_search = false) |
|
208 | { |
|
209 | $this->geo = new GeoFixer(); |
|
210 | ||
211 | $this->geo->isStrict($strict_search); |
|
212 | $this->geo->isFirstLetters($first_letters); |
|
213 | ||
214 | $result = $this->geo->findFiasStreets($street, $city_id); |
|
215 | ||
216 | if ($result === false && $this->logger) { |
|
217 | $this->logger->warning('Не найдена улица ' . $street . ' в городе с id ' . $city_id . ' базы ФИАС'); |
|
218 | $this->logger->warning('Строгий режим: ' . (int) $strict_search); |
|
219 | $this->logger->warning('Режим "совпадают первые буквы": ' . (int) $first_letters . PHP_EOL); |
|
220 | } |
|
221 | ||
222 | return $result; |
|
223 | } |
|
224 | ||
225 | /** |
|
226 | * Поиск кода улицы по коду города в базе КЛАДР |
|
@@ 236-252 (lines=17) @@ | ||
233 | * |
|
234 | * @return string|false |
|
235 | */ |
|
236 | public function findKladrStreet($street, $city_code, $first_letters = false, $strict_search = false) |
|
237 | { |
|
238 | $this->geo = new GeoFixer(); |
|
239 | ||
240 | $this->geo->isStrict($strict_search); |
|
241 | $this->geo->isFirstLetters($first_letters); |
|
242 | ||
243 | $result = $this->geo->findKladrStreets($street, $city_code); |
|
244 | ||
245 | if ($result === false && $this->logger) { |
|
246 | $this->logger->warning('Не найдена улица ' . $street . ' в городе с кодом ' . $city_code . ' базы КЛАДР'); |
|
247 | $this->logger->warning('Строгий режим: ' . (int) $strict_search); |
|
248 | $this->logger->warning('Режим "совпадают первые буквы": ' . (int) $first_letters . PHP_EOL); |
|
249 | } |
|
250 | ||
251 | return $result; |
|
252 | } |
|
253 | ||
254 | ||
255 | /** |