Exemple #1
0
 /**
  * Save value
  *
  * @return void
  */
 public function saveValue()
 {
     foreach ($this->getFields() as $field) {
         if ('' === $field['widget']->getValue()) {
             $defaultValue = true;
             $field['widget']->setValue($this->getEmptyFieldValue());
         } else {
             $defaultValue = false;
         }
         $method = 'setDefault' . ucfirst($field['field'][static::FIELD_NAME]);
         $this->getEntity()->{$method}($defaultValue);
     }
     parent::saveValue();
 }
Exemple #2
0
 /**
  * Get initial field parameters
  *
  * @param array $field Field data
  *
  * @return array
  */
 protected function getFieldParams(array $field)
 {
     return parent::getFieldParams($field) + array('maxlength' => 32);
 }
Exemple #3
0
 /**
  * Get initial field parameters
  *
  * @param array $field Field data
  *
  * @return array
  */
 protected function getFieldParams(array $field)
 {
     return parent::getFieldParams($field) + array('maxlength' => 32, 'placeholder' => static::t('Default'));
 }
 /**
  * Get container class
  *
  * @return string
  */
 protected function getContainerClass()
 {
     return parent::getContainerClass() . ' inline-address-fields-service-name';
 }