EntityNeedsSaveTrait.php in Entity Reference Revisions 8
File
src/EntityNeedsSaveTrait.php
View source
<?php
namespace Drupal\entity_reference_revisions;
use Drupal\Core\Entity\EntityStorageInterface;
trait EntityNeedsSaveTrait {
protected $needsSave = FALSE;
public function needsSave() {
return $this->needsSave;
}
public function setNeedsSave($needs_save) {
$this->needsSave = $needs_save;
}
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
$this
->setNeedsSave(FALSE);
}
}