Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php \Drupal\entity_test\Entity\EntityTestMulChanged::save()
  2. 9 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php \Drupal\entity_test\Entity\EntityTestMulChanged::save()

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown.

Overrides EntityInterface::save

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php, line 72

Class

EntityTestMulChanged
Defines the test entity class.

Namespace

Drupal\entity_test\Entity

Code

public function save() {

  // Ensure a new timestamp.
  sleep(1);
  return parent::save();
}