/**
  * {@inheritdoc}
  */
 public function preSave()
 {
     parent::preSave();
     if ($this->entity instanceof EntityNeedsSaveInterface && $this->entity->needsSave()) {
         $this->entity->save();
     }
     if ($this->entity) {
         $this->target_revision_id = $this->entity->getRevisionId();
     }
 }
 /**
  * {@inheritdoc}
  */
 public function preSave()
 {
     parent::preSave();
     $this->target_revision_id = $this->entity->getRevisionId();
 }