You are here

public function EntityTestMulChanged::save in Drupal 8

Same name and namespace in other branches
  1. 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 EntityBase::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);
  parent::save();
}