Example #1
0
 /**
  * Add field form of particular name.
  *
  * @access     public
  * @param      Form\Field $oField
  * @return     MConfig
  * @since      1.0.0-alpha
  * @version    1.0.0-alpha
  */
 public function addField(Form\Field $oField)
 {
     $this->aFields[$oField->getName()] = $oField;
     return $this;
 }
Example #2
0
 /**
  * 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;
 }