コード例 #1
0
ファイル: Abstract.php プロジェクト: cargomedia/cm
 /**
  * @param CM_FormField_Abstract $field
  * @throws CM_Exception_Invalid
  */
 protected function registerField(CM_FormField_Abstract $field)
 {
     $fieldName = $field->getName();
     if ($this->hasField($fieldName)) {
         throw new CM_Exception_Invalid('Form field is already registered.', null, ['fieldName' => $fieldName]);
     }
     $this->_fields[$fieldName] = $field;
 }
コード例 #2
0
ファイル: Abstract.php プロジェクト: aladin1394/CM
 /**
  * @param CM_FormField_Abstract $field
  * @throws CM_Exception_Invalid
  */
 protected function registerField(CM_FormField_Abstract $field)
 {
     $fieldName = $field->getName();
     if (isset($this->_fields[$fieldName])) {
         throw new CM_Exception_Invalid('Form field `' . $fieldName . '` is already registered.');
     }
     $this->_fields[$fieldName] = $field;
 }