public function TestEntityController::preSaveRevision

Overrides Drupal\Core\Entity\DatabaseStorageController::preSaveRevision().

Overrides DatabaseStorageController::preSaveRevision

File

drupal/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityController.php, line 21
Definition of Drupal\field_test\TestEntityController.

Class

TestEntityController
Controller class for the test entity entity types.

Namespace

Drupal\field_test

Code

public function preSaveRevision(\stdClass $record, EntityInterface $entity) {

  // Allow for predefined revision ids.
  if (!empty($record->use_provided_revision_id)) {
    $record->ftvid = $record->use_provided_revision_id;
  }
}