| Conditions | 3 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | private function _get($field = null, $value = null) |
||
| 50 | { |
||
| 51 | $packet = $this->_client->getPacket(); |
||
| 52 | $getTag = $packet->addChild($this->_wrapperTag)->addChild('get'); |
||
| 53 | |||
| 54 | $filterTag = $getTag->addChild('filter'); |
||
| 55 | if (!is_null($field)) { |
||
| 56 | $filterTag->addChild($field, $value); |
||
| 57 | } |
||
| 58 | |||
| 59 | $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL); |
||
| 60 | |||
| 61 | $items = []; |
||
| 62 | foreach ($response->xpath('//result') as $xmlResult) { |
||
| 63 | $item = new Struct\Info($xmlResult->data); |
||
| 64 | $item->id = (int) $xmlResult->id; |
||
| 65 | $items[] = $item; |
||
| 66 | } |
||
| 67 | |||
| 68 | return $items; |
||
| 69 | } |
||
| 70 | } |
||
| 71 |