Same filename and directory in other branches
- 8.9.x core/modules/user/src/ProfileTranslationHandler.php
- 9 core/modules/user/src/ProfileTranslationHandler.php
Namespace
Drupal\user
File
core/modules/user/src/ProfileTranslationHandler.php
View source
<?php
namespace Drupal\user;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationHandler;
use Drupal\Core\Form\FormStateInterface;
class ProfileTranslationHandler extends ContentTranslationHandler {
protected function hasPublishedStatus() {
return FALSE;
}
protected function hasCreatedTime() {
return FALSE;
}
public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
$form['actions']['submit']['#submit'][] = [
$this,
'entityFormSave',
];
}
public function entityFormSave(array $form, FormStateInterface $form_state) {
if ($this
->getSourceLangcode($form_state)) {
$entity = $form_state
->getFormObject()
->getEntity();
$form_state
->setRedirectUrl($entity
->toUrl());
}
}
}
Classes