From 4aebc4a20369578559ef094e5d26fbae7806578f Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 2 Jul 2021 12:30:18 -0400 Subject: [PATCH] Add __debugInfo() method to Inputfield class --- wire/core/Inputfield.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/wire/core/Inputfield.php b/wire/core/Inputfield.php index 26cebafa..b6b9adf2 100644 --- a/wire/core/Inputfield.php +++ b/wire/core/Inputfield.php @@ -1840,6 +1840,29 @@ abstract class Inputfield extends WireData implements Module { if(!is_null($setEditable)) $this->editable = $setEditable ? true : false; return $this->editable; } + + /** + * debugInfo PHP 5.6+ magic method + * + * @return array + * + */ + public function __debugInfo() { + $info = array( + 'className' => $this->className(), + 'attributes' => $this->attributes, + 'wrapAttributes' => $this->wrapAttributes, + ); + if(is_object($this->parent)) { + $info['parent'] = array( + 'className' => $this->parent->className(), + 'name' => $this->parent->attr('name'), + 'id' => $this->parent->attr('id'), + ); + } + $info = array_merge($info, parent::__debugInfo()); + return $info; + } /** * Set custom html render, see $this->html at top for reference.