3 namespace Drupal\entity_reference_revisions;
4 use Drupal\Core\Entity\EntityStorageInterface;
7 * Trait for EntityNeedsSaveInterface.
9 trait EntityNeedsSaveTrait {
12 * Whether the entity needs to be saved or not.
16 protected $needsSave = FALSE;
21 public function needsSave() {
22 return $this->needsSave;
28 public function setNeedsSave($needs_save) {
29 $this->needsSave = $needs_save;
35 public function postSave(EntityStorageInterface $storage, $update = TRUE) {
36 parent::postSave($storage, $update);
37 $this->setNeedsSave(FALSE);