Skip to content
Snippets Groups Projects
Commit edb46e0c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2100183 by plopesc: Remove the changed() method from EntityInterface.

parent 03a7c55f
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -340,7 +340,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) {
* {@inheritdoc}
*/
public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) {
$this->changed();
$this->onSaveOrDelete();
}
/**
......@@ -366,7 +366,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr
*/
public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) {
foreach ($entities as $entity) {
$entity->changed();
$entity->onSaveOrDelete();
}
}
......@@ -384,9 +384,9 @@ public function referencedEntities() {
}
/**
* {@inheritdoc}
* Acts on an entity after it was saved or deleted.
*/
public function changed() {
protected function onSaveOrDelete() {
$referenced_entities = array(
$this->entityType() => array($this->id() => $this),
);
......
......@@ -235,9 +235,4 @@ public function entityInfo();
*/
public function referencedEntities();
/**
* Acts on an entity after it was saved or deleted.
*/
public function changed();
}
......@@ -52,6 +52,7 @@ public function testLocks() {
$methods = get_class_methods('Drupal\comment\Entity\Comment');
unset($methods[array_search('preSave', $methods)]);
unset($methods[array_search('postSave', $methods)]);
$methods[] = 'onSaveOrDelete';
$comment = $this->getMockBuilder('Drupal\comment\Entity\Comment')
->disableOriginalConstructor()
->setMethods($methods)
......
......@@ -1160,11 +1160,4 @@ public function referencedEntities() {
return $this->storage->referencedEntities();
}
/**
* {@inheritdoc}
*/
public function changed() {
return $this->storage->changed();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment