Conditions | 4 |
Paths | 8 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function get($id = null) |
||
16 | { |
||
17 | $locales = []; |
||
18 | $packet = $this->_client->getPacket(); |
||
19 | $filter = $packet->addChild($this->_wrapperTag)->addChild('get')->addChild('filter'); |
||
20 | |||
21 | if (!is_null($id)) { |
||
22 | $filter->addChild('id', $id); |
||
23 | } |
||
24 | |||
25 | $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); |
||
26 | |||
27 | foreach ($response->locale->get->result as $localeInfo) { |
||
28 | $locales[(string) $localeInfo->info->id] = new Struct\Info($localeInfo->info); |
||
29 | } |
||
30 | |||
31 | return !is_null($id) ? reset($locales) : $locales; |
||
32 | } |
||
33 | } |
||
34 |