|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Copyright (C) 2022 synetics GmbH |
| 5 | + * Copyright (C) 2016-2022 Benjamin Heisig |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU Affero General Public License as published by |
| 9 | + * the Free Software Foundation, either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU Affero General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Affero General Public License |
| 18 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + * |
| 20 | + * @author Benjamin Heisig <https://benjamin.heisig.name/> |
| 21 | + * @copyright Copyright (C) 2022 synetics GmbH |
| 22 | + * @copyright Copyright (C) 2016-2022 Benjamin Heisig |
| 23 | + * @license http://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License (AGPL) |
| 24 | + * @link https://github.com/i-doit/api-client-php |
| 25 | + */ |
| 26 | + |
| 27 | +declare(strict_types=1); |
| 28 | + |
| 29 | +namespace Idoit\APIClient; |
| 30 | + |
| 31 | +use \Exception; |
| 32 | + |
| 33 | +/** |
| 34 | + * Requests for API namespace 'cmdb.condition' |
| 35 | + */ |
| 36 | +class CMDBCondition extends Request { |
| 37 | + |
| 38 | + const ATTRIBUTE_CONDITIONS = 'conditions'; |
| 39 | + |
| 40 | + /** |
| 41 | + * Get list of objects filtered by conditions |
| 42 | + * |
| 43 | + * @param array $conditions array of conditions |
| 44 | + * |
| 45 | + * @return array Indexed array of associative arrays |
| 46 | + * |
| 47 | + * @throws Exception on error |
| 48 | + */ |
| 49 | + public function read($conditions): array { |
| 50 | + return $this->api->request( |
| 51 | + 'cmdb.condition.read', |
| 52 | + [ |
| 53 | + 'conditions' => $conditions |
| 54 | + ] |
| 55 | + ); |
| 56 | + } |
| 57 | + |
| 58 | +} |
0 commit comments