1 | <?php |
||
26 | class Api |
||
27 | { |
||
28 | /** |
||
29 | * @var \mrcnpdlk\MojePanstwo\Api |
||
30 | */ |
||
31 | protected static $instance = null; |
||
32 | |||
33 | /** |
||
34 | * @var \mrcnpdlk\MojePanstwo\Client |
||
35 | */ |
||
36 | private $oClient; |
||
37 | |||
38 | /** |
||
39 | * Api constructor. |
||
40 | * |
||
41 | * @param \mrcnpdlk\MojePanstwo\Client $oClient |
||
42 | */ |
||
43 | 1 | protected function __construct(Client $oClient) |
|
47 | |||
48 | /** |
||
49 | * @param \mrcnpdlk\MojePanstwo\Client $oClient |
||
50 | * |
||
51 | * @return \mrcnpdlk\MojePanstwo\Api |
||
52 | */ |
||
53 | 10 | public static function create(Client $oClient) |
|
61 | |||
62 | /** |
||
63 | * @return \mrcnpdlk\MojePanstwo\Api |
||
64 | * @throws \mrcnpdlk\MojePanstwo\Exception |
||
65 | */ |
||
66 | 7 | public static function getInstance() |
|
74 | |||
75 | /** |
||
76 | * @return \mrcnpdlk\MojePanstwo\Client |
||
77 | */ |
||
78 | 8 | public function getClient() |
|
82 | |||
83 | /** |
||
84 | * @param $id |
||
85 | * |
||
86 | * @return Commune |
||
87 | */ |
||
88 | 1 | public function getCommune($id) |
|
94 | |||
95 | /** |
||
96 | * @param $id |
||
97 | * |
||
98 | * @return District |
||
99 | */ |
||
100 | public function getDistrict($id) |
||
106 | |||
107 | /** |
||
108 | * Return KRS Entity by ID (krs) |
||
109 | * |
||
110 | * @param string|int $krs ID or KRS number |
||
111 | * |
||
112 | * @param int $pullFlag Additional layers. E.i: KrsEntity::PULL_PKDS | KrsEntity::PULL_PERSON_REPRESENTATION |
||
113 | * |
||
114 | * @return \mrcnpdlk\MojePanstwo\Model\KrsEntity |
||
115 | */ |
||
116 | public function getKrsEntity($krs, int $pullFlag = KrsEntity::PULL_NONE) |
||
150 | |||
151 | /** |
||
152 | * Return KRS Entity Type |
||
153 | * |
||
154 | * @param $id |
||
155 | * |
||
156 | * @return \mrcnpdlk\MojePanstwo\Model\KrsEntityType |
||
157 | */ |
||
158 | public function getKrsEntityType($id) |
||
164 | |||
165 | /** |
||
166 | * Return Province |
||
167 | * |
||
168 | * @param $id |
||
169 | * |
||
170 | * @return Province |
||
171 | */ |
||
172 | 1 | public function getProvince($id) |
|
178 | |||
179 | /** |
||
180 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
181 | */ |
||
182 | 1 | public function searchCommune() |
|
186 | |||
187 | /** |
||
188 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
189 | */ |
||
190 | 1 | public function searchDistrict() |
|
194 | |||
195 | /** |
||
196 | * Return QueryBuilder for searching KRS Entities |
||
197 | * |
||
198 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
199 | */ |
||
200 | 1 | public function searchKrsEntity() |
|
204 | |||
205 | /** |
||
206 | * Return QueryBuilder for searching KRS Entity Types |
||
207 | * |
||
208 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
209 | */ |
||
210 | 1 | public function searchKrsEntityType() |
|
214 | |||
215 | /** |
||
216 | * @return \mrcnpdlk\MojePanstwo\QueryBuilder |
||
217 | */ |
||
218 | 1 | public function searchProvince() |
|
222 | |||
223 | } |
||
224 |