From f66ab8dae2f3d0418759f81a3a64dc9517a62449 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 15:17:31 +0200 Subject: Adding upstream version 1.10.2. Signed-off-by: Daniel Baumann --- library/Director/RestApi/RestApiParams.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 library/Director/RestApi/RestApiParams.php (limited to 'library/Director/RestApi/RestApiParams.php') diff --git a/library/Director/RestApi/RestApiParams.php b/library/Director/RestApi/RestApiParams.php new file mode 100644 index 0000000..c237ac5 --- /dev/null +++ b/library/Director/RestApi/RestApiParams.php @@ -0,0 +1,29 @@ +getUrl()->getParams(); + $resolved = (bool) $params->get('resolved', false); + $withNull = $params->shift('withNull'); + if ($params->get('withServices')) { + if ($shortObjectType !== 'host') { + throw new InvalidArgumentException('withServices is available for Hosts only'); + } + $exporter->enableHostServices(); + } + $properties = $params->shift('properties'); + if ($properties !== null && strlen($properties)) { + $exporter->filterProperties(preg_split('/\s*,\s*/', $properties, -1, PREG_SPLIT_NO_EMPTY)); + } + $exporter->resolveObjects($resolved); + $exporter->showDefaults($withNull); + } +} -- cgit v1.2.3