protected function DataPolicyRevisionRevertForm::prepareRevertedRevision in Data Policy 8
Prepares a revision to be reverted.
Parameters
\Drupal\data_policy\Entity\DataPolicyInterface $revision: The revision to be reverted.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
\Drupal\data_policy\Entity\DataPolicyInterface The prepared revision ready to be stored.
1 call to DataPolicyRevisionRevertForm::prepareRevertedRevision()
- DataPolicyRevisionRevertForm::submitForm in src/
Form/ DataPolicyRevisionRevertForm.php - Form submission handler.
1 method overrides DataPolicyRevisionRevertForm::prepareRevertedRevision()
- DataPolicyRevisionRevertTranslationForm::prepareRevertedRevision in src/
Form/ DataPolicyRevisionRevertTranslationForm.php - Prepares a revision to be reverted.
File
- src/
Form/ DataPolicyRevisionRevertForm.php, line 159
Class
- DataPolicyRevisionRevertForm
- Provides a form for reverting a Data policy revision.
Namespace
Drupal\data_policy\FormCode
protected function prepareRevertedRevision(DataPolicyInterface $revision, FormStateInterface $form_state) {
$revision
->setNewRevision();
$revision
->isDefaultRevision(FALSE);
$revision
->setRevisionCreationTime($this->time
->getRequestTime());
return $revision;
}