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

8.0.x
Alex Pott 2014-01-25 20:05:32 +01:00
parent 03a7c55fdb
commit edb46e0c26
4 changed files with 5 additions and 16 deletions

View File

@ -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),
);

View File

@ -235,9 +235,4 @@ interface EntityInterface extends AccessibleInterface {
*/
public function referencedEntities();
/**
* Acts on an entity after it was saved or deleted.
*/
public function changed();
}

View File

@ -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)

View File

@ -1160,11 +1160,4 @@ class ViewUI implements ViewStorageInterface {
return $this->storage->referencedEntities();
}
/**
* {@inheritdoc}
*/
public function changed() {
return $this->storage->changed();
}
}