/** * Find the form in which this component is located * @return Form The form to which this component belongs */ public function getForm() { $form; $callback = function ($component) use(&$form) { $form = $component; return Component::VISITOR_STOP_TRAVERSAL; }; $this->visitParents(Form::getIdentifier(), $callback); return $form; }