From 39987677f031f17f0fb598a9be50767d3f5b6aa0 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 10 Jan 2019 17:57:32 -0600 Subject: [PATCH] Peer review of 1b3263d4c7004c7b036ab8ae8b8fee3cfb6928b5 --- modules/backend/classes/FormField.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/modules/backend/classes/FormField.php b/modules/backend/classes/FormField.php index 991ab2b68..bb646fba9 100644 --- a/modules/backend/classes/FormField.php +++ b/modules/backend/classes/FormField.php @@ -177,21 +177,31 @@ class FormField public $preset; /** - * @var Backend\Widgets\Form The form that contains this field + * @var object The parent object that contains this field */ - public $form; + protected $parent = null; /** * Constructor. * @param string $fieldName The name of the field * @param string $label The label of the field - * @param Backend\Widgets\Form $form The containing form + * @param object $parent The containing object instance, defaults to null */ - public function __construct($fieldName, $label, $form) + public function __construct($fieldName, $label, $parent = null) { $this->fieldName = $fieldName; $this->label = $label; - $this->form = $form; + $this->parent = $parent; + } + + /** + * Retrieve the parent object for the field + * + * @return object|null + */ + public function getParent() + { + return $this->parent; } /**