Matthias\SymfonyConsoleForm\Form\FormUtil::isCompound PHP Метод

isCompound() публичный статический Метод

public static isCompound ( Symfony\Component\Form\FormInterface $form ) : boolean
$form Symfony\Component\Form\FormInterface
Результат boolean
    public static function isCompound(FormInterface $form)
    {
        return $form->getConfig()->getCompound();
    }

Usage Example

 public function interactWith(FormInterface $form, HelperSet $helperSet, InputInterface $input, OutputInterface $output)
 {
     if (!$input->isInteractive()) {
         throw new CanNotInteractWithForm('This interactor only works with interactive input');
     }
     if (!FormUtil::isCompound($form)) {
         throw new CanNotInteractWithForm('Expected a compound form');
     }
     $submittedData = [];
     foreach ($form->all() as $name => $field) {
         try {
             $submittedData[$name] = $this->formInteractor->interactWith($field, $helperSet, $input, $output);
         } catch (NoNeedToInteractWithForm $exception) {
             continue;
         }
     }
     return $submittedData;
 }