@@ 7-27 (lines=21) @@ | ||
4 | namespace PleskX\Api\Operator; |
|
5 | use PleskX\Api\Struct\Certificate as Struct; |
|
6 | ||
7 | class Certificate extends \PleskX\Api\Operator |
|
8 | { |
|
9 | ||
10 | /** |
|
11 | * @param array $properties |
|
12 | * @return Struct\Info |
|
13 | */ |
|
14 | public function generate($properties) |
|
15 | { |
|
16 | $packet = $this->_client->getPacket(); |
|
17 | $info = $packet->addChild($this->_wrapperTag)->addChild('generate')->addChild('info'); |
|
18 | ||
19 | foreach ($properties as $name => $value) { |
|
20 | $info->addChild($name, $value); |
|
21 | } |
|
22 | ||
23 | $response = $this->_client->request($packet); |
|
24 | return new Struct\Info($response); |
|
25 | } |
|
26 | ||
27 | } |
|
28 |
@@ 7-35 (lines=29) @@ | ||
4 | namespace PleskX\Api\Operator; |
|
5 | use PleskX\Api\Struct\Subdomain as Struct; |
|
6 | ||
7 | class Subdomain extends \PleskX\Api\Operator |
|
8 | { |
|
9 | /** |
|
10 | * @param array $properties |
|
11 | * @return Struct\Info |
|
12 | */ |
|
13 | public function create($properties) |
|
14 | { |
|
15 | $packet = $this->_client->getPacket(); |
|
16 | $info = $packet->addChild($this->_wrapperTag)->addChild('add'); |
|
17 | ||
18 | foreach ($properties as $name => $value) { |
|
19 | $info->addChild($name, $value); |
|
20 | } |
|
21 | ||
22 | $response = $this->_client->request($packet); |
|
23 | return new Struct\Info($response); |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * @param string $field |
|
28 | * @param integer|string $value |
|
29 | * @return bool |
|
30 | */ |
|
31 | public function delete($field, $value) |
|
32 | { |
|
33 | return $this->_delete($field, $value); |
|
34 | } |
|
35 | } |
|
36 |