From acfcd7a572d190b6d798b3153282065964c6208f Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 13 Jul 2018 09:02:35 +0200 Subject: [PATCH] Add missing documentation See #2509 --- .../form/builder/field/TSelectionFormField.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php index 6dbf415b4a..c809bf99a2 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php @@ -23,6 +23,7 @@ trait TSelectionFormField { protected $__filterable = false; /** + * structured options array used to generate the form field output * @var null|array */ protected $__nestedOptions; @@ -47,6 +48,14 @@ trait TSelectionFormField { return $this; } + /** + * Returns a structured array that can be used to generate the form field output. + * + * Array elements are `value`, `label`, and `depth`. + * + * @return array + * @throws \BadMethodCallException if nested options are not supported + */ public function getNestedOptions(): array { if (!$this->supportsNestedOptions()) { throw new \BadMethodCallException("Nested options are not supported."); -- 2.20.1