protected function EntityPublisher::defaultSave in Content Synchronizer 3.x
Same name and namespace in other branches
- 8.2 src/Service/EntityPublisher.php \Drupal\content_synchronizer\Service\EntityPublisher::defaultSave()
- 8 src/Service/EntityPublisher.php \Drupal\content_synchronizer\Service\EntityPublisher::defaultSave()
Save without publish status care.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to save.
\Drupal\Core\Entity\EntityInterface $existingEntity: The existing entity before changes.
1 call to EntityPublisher::defaultSave()
- EntityPublisher::saveEntityWithUnpublishedStatus in src/
Service/ EntityPublisher.php - Try to unpublish entity if it needs to be created. Either default save.
File
- src/
Service/ EntityPublisher.php, line 148
Class
- EntityPublisher
- THe entity publsher service.
Namespace
Drupal\content_synchronizer\ServiceCode
protected function defaultSave(EntityInterface $entity, EntityInterface $existingEntity = NULL) {
if ($this
->haveToSave($entity, $existingEntity)) {
if (is_null($entity
->uuid())) {
$entity->uuid = $this->uuid
->generate();
}
$entity
->save();
}
}