Commit edb46e0c authored by alexpott's avatar alexpott

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

parent 03a7c55f
......@@ -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();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment