Issue #2100183 by plopesc: Remove the changed() method from EntityInterface.
parent
03a7c55fdb
commit
edb46e0c26
|
@ -340,7 +340,7 @@ abstract class Entity implements EntityInterface {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) {
|
||||
$this->changed();
|
||||
$this->onSaveOrDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -366,7 +366,7 @@ abstract class Entity implements EntityInterface {
|
|||
*/
|
||||
public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) {
|
||||
foreach ($entities as $entity) {
|
||||
$entity->changed();
|
||||
$entity->onSaveOrDelete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -384,9 +384,9 @@ abstract class Entity implements EntityInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* {@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 @@ interface EntityInterface extends AccessibleInterface {
|
|||
*/
|
||||
public function referencedEntities();
|
||||
|
||||
/**
|
||||
* Acts on an entity after it was saved or deleted.
|
||||
*/
|
||||
public function changed();
|
||||
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ class CommentLockTest extends UnitTestCase {
|
|||
$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 @@ class ViewUI implements ViewStorageInterface {
|
|||
return $this->storage->referencedEntities();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function changed() {
|
||||
return $this->storage->changed();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue