1 | <?php |
||
6 | class Operator |
||
7 | { |
||
8 | /** @var string|null */ |
||
9 | protected $_wrapperTag = null; |
||
10 | |||
11 | /** @var \PleskX\Api\Client */ |
||
12 | protected $_client; |
||
13 | |||
14 | public function __construct($client) |
||
15 | { |
||
16 | $this->_client = $client; |
||
17 | |||
18 | if (is_null($this->_wrapperTag)) { |
||
19 | $classNameParts = explode('\\', get_class($this)); |
||
20 | $this->_wrapperTag = end($classNameParts); |
||
21 | $this->_wrapperTag = strtolower(preg_replace('/([a-z])([A-Z])/', '\1-\2', $this->_wrapperTag)); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Perform plain API request. |
||
27 | * |
||
28 | * @param string|array $request |
||
29 | * @param int $mode |
||
30 | * |
||
31 | * @return XmlResponse |
||
32 | */ |
||
33 | public function request($request, $mode = Client::RESPONSE_SHORT) |
||
47 | |||
48 | /** |
||
49 | * @param string $field |
||
50 | * @param int|string $value |
||
51 | * @param string $deleteMethodName |
||
52 | * |
||
53 | * @return bool |
||
54 | */ |
||
55 | protected function _delete($field, $value, $deleteMethodName = 'del') |
||
67 | |||
68 | /** |
||
69 | * @param string $structClass |
||
70 | * @param string $infoTag |
||
71 | * @param string|null $field |
||
72 | * @param int|string|null $value |
||
73 | * @param callable|null $filter |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | protected function _getItems($structClass, $infoTag, $field = null, $value = null, callable $filter = null) |
||
104 | } |
||
105 |