Basically, it is just a wrapper around `getNodeById()`, which also checks whether it is a `IFormField`.
$this->traitValidate();
}
}
+
+ /**
+ * @inheritDoc
+ */
+ public function getFormField(string $nodeId): ?IFormField
+ {
+ $node = $this->getNodeById($nodeId);
+ if ($node === null) {
+ return null;
+ }
+ if (!($node instanceof IFormField)) {
+ return null;
+ }
+
+ return $node;
+ }
}
use wcf\data\IStorableObject;
use wcf\system\form\builder\button\IFormButton;
use wcf\system\form\builder\data\IFormDataHandler;
+use wcf\system\form\builder\field\IFormField;
/**
* Represents a "whole" form (document).
* @throws \InvalidArgumentException if the given form mode is invalid
*/
public function successMessage($languageItem = null, array $variables = []);
+
+ /**
+ * Returns the form field with the given id or `null` if no such field exists.
+ *
+ * @since 6.1
+ */
+ public function getFormField(string $nodeId): ?IFormField;
}