Ejemplo n.º 1
0
 /**
  * Update ui_label db values with form values (localized)
  *
  * @return $this
  */
 protected function updateUiLabelSettings($form)
 {
     foreach ($form->getSettings() as $setting) {
         if (null !== ($value = $form->getValue($setting->getName()))) {
             $setting->setValue($value);
             $setting->save();
         }
     }
     // Add a new ui_label
     if (null !== ($newName = $form->getValue('new_setting_name')) && strlen($newValue = $form->getValue('new_setting_value'))) {
         $setting = QubitSetting::createNewSetting($newName, $newValue, array('scope' => $form->getScope()));
         $setting->save();
     }
     return $this;
 }