예제 #1
0
 /**
  * @param BaseControl|Container $formElement
  * @return array|\ArrayIterator
  * @throws \Kdyby\DoctrineForms\InvalidArgumentException
  */
 private static function iterate($formElement)
 {
     if ($formElement instanceof Container) {
         return $formElement->getComponents();
     } elseif ($formElement instanceof IControl) {
         return array($formElement);
     } else {
         throw new Kdyby\DoctrineForms\InvalidArgumentException('Expected Nette\\Forms\\Container or Nette\\Forms\\IControl, but ' . get_class($formElement) . ' given');
     }
 }