/** * @param array|\Traversable|ElementInterface $elementOrFieldset * @param array $flags * @return void|\Zend\Form\Fieldset|\Zend\Form\FieldsetInterface|\Zend\Form\FormInterface */ public function add($elementOrFieldset, array $flags = array()) { if ($elementOrFieldset instanceof ElementInterface) { $elementOrFieldset->setForm($this); } parent::add($elementOrFieldset, $flags); }
protected function isRequired(CtrlElement $element) { if ($element instanceof \Ctrl\Form\Element\ElementInterface && $element->getForm()->getInputFilter() && $element->getForm()->getInputFilter()->has($element->getName()) && $element->getForm()->getInputFilter()->get($element->getName())->isRequired()) { return true; } return false; }