|
@@ -241,6 +241,16 @@ class Field extends Configurable implements FieldInterface
|
|
|
return $this->parent;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns whether the field has a parent.
|
|
|
+ *
|
|
|
+ * @return Boolean
|
|
|
+ */
|
|
|
+ public function hasParent()
|
|
|
+ {
|
|
|
+ return null !== $this->parent;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Returns the root of the form tree
|
|
|
*
|
|
@@ -251,6 +261,16 @@ class Field extends Configurable implements FieldInterface
|
|
|
return $this->parent ? $this->parent->getRoot() : $this;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns whether the field is the root of the form tree
|
|
|
+ *
|
|
|
+ * @return Boolean
|
|
|
+ */
|
|
|
+ public function isRoot()
|
|
|
+ {
|
|
|
+ return !$this->hasParent();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Updates the field with default data
|
|
|
*
|