/** * Set new \Plethora\Form object to particular form Field if is singleton. * * @access public * @param Form $form * @return Field * @since 1.0.0-alpha * @version 1.0.0-alpha */ public function setFormIfSingleton(Form &$form) { $form->addEnctype(); parent::setFormIfSingleton($form); // TODO: Change the autogenerated stub }
/** * Add singleton field to this form. * * @access public * @param Form\Field $oField * @return Form * @throws Exception * @since 1.0.0-alpha * @version 1.0.0-alpha */ public function addSingleton(Field $oField) { if ($oField->getFormObject()->getName() !== 'singletons') { throw new Exception('This field is not a singleton.'); } $oField->setFormIfSingleton($this); $this->fields[$oField->getName()] = $oField; return $this; }