Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }
Ejemplo n.º 3
0
 protected function _initialize()
 {
     $this->_values = $this->_params->getArray('values', array());
     $this->_labelsInValues = $this->_params->getBoolean('labelsInValues', false);
     $this->_translate = $this->_params->getBoolean('translate', false);
     parent::_initialize();
 }
Ejemplo n.º 4
0
 protected function _initialize()
 {
     $this->_options['min'] = $this->_params->getInt('min', 0);
     $this->_options['max'] = $this->_params->getInt('max', 100);
     $this->_options['step'] = $this->_params->getInt('step', 1);
     parent::_initialize();
 }
Ejemplo n.º 5
0
 protected function _initialize()
 {
     $this->_options['lengthMin'] = $this->_params->has('lengthMin') ? $this->_params->getInt('lengthMin') : null;
     $this->_options['lengthMax'] = $this->_params->has('lengthMax') ? $this->_params->getInt('lengthMax') : null;
     $this->_options['forbidBadwords'] = $this->_params->getBoolean('forbidBadwords', false);
     parent::_initialize();
 }
Ejemplo n.º 6
0
 protected function _initialize()
 {
     $this->_timeZone = $this->_params->has('timeZone') ? $this->_params->getDateTimeZone('timeZone') : null;
     $this->_yearFirst = $this->_params->getInt('yearFirst', date('Y') - 100);
     $this->_yearLast = $this->_params->getInt('yearLast', date('Y'));
     parent::_initialize();
 }
Ejemplo n.º 7
0
 protected function _initialize()
 {
     $this->_options['cardinality'] = $this->_params->has('cardinality') ? $this->_params->getInt('cardinality') : null;
     $this->_options['enableChoiceCreate'] = $this->_params->getBoolean('enableChoiceCreate', false);
     parent::_initialize();
 }
Ejemplo n.º 8
0
 protected function _initialize()
 {
     $this->_options['cardinality'] = $this->_params->getInt('cardinality', 1);
     $this->_options['allowedExtensions'] = $this->_getAllowedExtensions();
     parent::_initialize();
 }
Ejemplo n.º 9
0
 /**
  * @param array $userInput
  * @return bool
  */
 public function isEmpty($userInput)
 {
     return parent::isEmpty($userInput) || CM_FormField_Abstract::isEmpty($userInput['z']);
 }
Ejemplo n.º 10
0
 /**
  * @expectedException CM_Exception_Invalid
  */
 public function testFactoryInvalid()
 {
     $className = 'InvalidFormFieldClass';
     CM_FormField_Abstract::factory($className);
 }
Ejemplo n.º 11
0
 protected function _initialize()
 {
     $this->_yearFirst = $this->_params->getInt('yearFirst', date('Y') - 100);
     $this->_yearLast = $this->_params->getInt('yearLast', date('Y'));
     parent::_initialize();
 }
Ejemplo n.º 12
0
 /**
  * @param array $userInput
  * @return bool
  */
 public function isEmpty($userInput)
 {
     return parent::isEmpty($userInput['x']) || parent::isEmpty($userInput['y']);
 }
Ejemplo n.º 13
0
 protected function _initialize()
 {
     $this->_tree = $this->_params->getObject('tree', 'CM_Tree_Abstract');
     parent::_initialize();
 }