public function LingotekProfileListBuilder::submitForm in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8 src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 8.2 src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 4.0.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.0.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.1.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.2.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.3.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.4.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.5.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.6.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
- 3.8.x src/LingotekProfileListBuilder.php \Drupal\lingotek\LingotekProfileListBuilder::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides DraggableListBuilder::submitForm
File
- src/
LingotekProfileListBuilder.php, line 146
Class
- LingotekProfileListBuilder
- Defines a class to build a listing of Lingotek profile entities.
Namespace
Drupal\lingotekCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Parent submit handler takes care of the weights, but not the checkboxes.
parent::submitForm($form, $form_state);
/** @var \Drupal\lingotek\LingotekProfileInterface $entity */
foreach ($this->entities as $entity_id => $entity) {
if (!$entity
->isLocked() && ($entity
->hasAutomaticRequest() != $form_state
->getValue([
'profile',
$entity_id,
'auto_request',
]) || $entity
->hasAutomaticUpload() != $form_state
->getValue([
'profile',
$entity_id,
'auto_upload',
]) || $entity
->hasAutomaticDownload() != $form_state
->getValue([
'profile',
$entity_id,
'auto_download',
]))) {
$entity
->setAutomaticUpload($form_state
->getValue([
'profile',
$entity_id,
'auto_upload',
]));
$entity
->setAutomaticRequest($form_state
->getValue([
'profile',
$entity_id,
'auto_request',
]));
$entity
->setAutomaticDownload($form_state
->getValue([
'profile',
$entity_id,
'auto_download',
]));
$entity
->save();
}
}
$this
->messenger()
->addStatus(t('Configuration saved.'));
}