1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* TERYT-API |
4
|
|
|
* |
5
|
|
|
* Copyright (c) 2017 pudelek.org.pl |
6
|
|
|
* |
7
|
|
|
* @license MIT License (MIT) |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please view source file |
10
|
|
|
* that is bundled with this package in the file LICENSE |
11
|
|
|
* @author Marcin Pudełek <[email protected]> |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Created by Marcin Pudełek <[email protected]> |
16
|
|
|
* Date: 06.09.2017 |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace mrcnpdlk\Teryt\ResponseModel\Territory; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class WyszukanaMiejscowosc |
23
|
|
|
*/ |
24
|
|
|
class WyszukanaMiejscowosc extends Miejscowosc |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Identyfikator miejscowości podstawowej |
28
|
|
|
* |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
public $cityParentId; |
32
|
|
|
/** |
33
|
|
|
* Symbol rodzaju miejscowości |
34
|
|
|
* |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
public $rmId; |
38
|
|
|
/** |
39
|
|
|
* Nazwa rodzaju miejscowości |
40
|
|
|
* |
41
|
|
|
* @var string |
42
|
|
|
*/ |
43
|
|
|
public $rmName; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* WyszukanaMiejscowosc constructor. |
47
|
|
|
* |
48
|
|
|
* @param \stdClass $oData Obiekt zwrócony z TerytWS1 |
49
|
|
|
* |
50
|
|
|
* @throws \mrcnpdlk\Teryt\Exception |
51
|
|
|
*/ |
52
|
1 |
|
public function __construct(\stdClass $oData) |
53
|
|
|
{ |
54
|
1 |
|
$this->communeId = $oData->Gmi; |
55
|
1 |
|
$this->communeName = $oData->Gmina; |
56
|
1 |
|
$this->cityName = $oData->Nazwa; |
57
|
1 |
|
$this->districtId = $oData->Pow; |
58
|
1 |
|
$this->districtName = $oData->Powiat; |
59
|
1 |
|
$this->rmId = $oData->Rm; |
60
|
1 |
|
$this->rmName = $oData->RodzajMiejscowosci; |
61
|
1 |
|
$this->communeTypeId = $oData->RodzajGminy; |
62
|
1 |
|
$this->cityId = $oData->Symbol; |
63
|
1 |
|
$this->cityParentId = $oData->SymbolPodst; |
64
|
1 |
|
$this->provinceId = $oData->Woj; |
65
|
1 |
|
$this->provinceName = $oData->Wojewodztwo; |
66
|
|
|
|
67
|
|
|
try { |
68
|
1 |
|
$this->statusDate = $oData->DataStanu ? (new \DateTime($oData->DataStanu))->format('Y-m-d') : null; |
69
|
|
|
} catch (\Exception $e) { |
70
|
|
|
$this->statusDate = null; |
71
|
|
|
} |
72
|
|
|
|
73
|
1 |
|
parent::__construct(); |
74
|
1 |
|
} |
75
|
|
|
} |
76
|
|
|
|