Conditions | 5 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function create(array $properties, array $preferences = []) |
||
16 | { |
||
17 | $packet = $this->_client->getPacket(); |
||
18 | $info = $packet->addChild($this->_wrapperTag)->addChild('create'); |
||
19 | |||
20 | if (count($preferences) > 0) { |
||
21 | $prefs = $info->addChild('pref'); |
||
22 | |||
23 | foreach ($preferences as $key => $value) { |
||
24 | $prefs->addChild($key, is_bool($value) ? ($value ? 1 : 0) : $value); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | $info->addChild('site-id', $properties['site-id']); |
||
29 | $info->addChild('name', $properties['name']); |
||
30 | |||
31 | $response = $this->_client->request($packet); |
||
32 | return new Struct\Info($response); |
||
33 | } |
||
34 | |||
36 |