function ContentModerationState::updateOrCreateFromEntity
Same name in other branches
- 8.9.x core/modules/content_moderation/src/Entity/ContentModerationState.php \Drupal\content_moderation\Entity\ContentModerationState::updateOrCreateFromEntity()
- 10 core/modules/content_moderation/src/Entity/ContentModerationState.php \Drupal\content_moderation\Entity\ContentModerationState::updateOrCreateFromEntity()
- 11.x core/modules/content_moderation/src/Entity/ContentModerationState.php \Drupal\content_moderation\Entity\ContentModerationState::updateOrCreateFromEntity()
Creates or updates an entity's moderation state whilst saving that entity.
@internal This method should only be called as a result of saving the related content entity.
Parameters
\Drupal\content_moderation\Entity\ContentModerationState $content_moderation_state: The content moderation entity content entity to create or save.
3 calls to ContentModerationState::updateOrCreateFromEntity()
- ContentModerationStateStorageSchemaTest::assertStorageException in core/
modules/ content_moderation/ tests/ src/ Kernel/ ContentModerationStateStorageSchemaTest.php - Assert if a storage exception is triggered when saving a given entity.
- EntityOperations::entityTranslationDelete in core/
modules/ content_moderation/ src/ EntityOperations.php - EntityOperations::updateOrCreateFromEntity in core/
modules/ content_moderation/ src/ EntityOperations.php - Creates or updates the moderation state of an entity.
File
-
core/
modules/ content_moderation/ src/ Entity/ ContentModerationState.php, line 112
Class
- ContentModerationState
- Defines the Content moderation state entity.
Namespace
Drupal\content_moderation\EntityCode
public static function updateOrCreateFromEntity(ContentModerationState $content_moderation_state) {
$content_moderation_state->realSave();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.