Matthias\SymfonyConsoleForm\Form\FormUtil::isTypeInAncestry PHP Method

isTypeInAncestry() public static method

public static isTypeInAncestry ( Symfony\Component\Form\FormInterface $form, mixed $type ) : boolean
$form Symfony\Component\Form\FormInterface
$type mixed
return boolean
    public static function isTypeInAncestry(FormInterface $form, $type)
    {
        return in_array($type, self::typeAncestry($form));
    }

Usage Example

 public function interactWith(FormInterface $form, HelperSet $helperSet, InputInterface $input, OutputInterface $output)
 {
     if (FormUtil::isTypeInAncestry($form, 'button')) {
         throw new NoNeedToInteractWithForm();
     }
     // by default, we let another interactor interact with this form
     throw new CanNotInteractWithForm();
 }
All Usage Examples Of Matthias\SymfonyConsoleForm\Form\FormUtil::isTypeInAncestry