Completed
Pull Request — master (#27)
by Dominik
05:54
created

SiteAlias::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 1
1
<?php
2
// Copyright 1999-2016. Parallels IP Holdings GmbH.
3
4
namespace PleskX\Api\Operator;
5
use PleskX\Api\Struct\SiteAlias as Struct;
6
7
class SiteAlias extends \PleskX\Api\Operator
8
{
9
/**
10
     * @param array $properties
11
     * @return Struct\Info
12
     */
13
    public function create(array $properties)
14
    {
15
        $packet = $this->_client->getPacket();
16
        $info = $packet->addChild($this->_wrapperTag)->addChild('create');
17
18
        $info->addChild('site-id', $properties['site-id']);
19
        $info->addChild('name', $properties['name']);
20
21
        $response = $this->_client->request($packet);
22
        return new Struct\Info($response);
23
    }
24
}
25