You are here

public static function ContentModerationState::updateOrCreateFromEntity in Drupal 8

Same name and namespace in other branches
  1. 9 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\Entity

Code

public static function updateOrCreateFromEntity(ContentModerationState $content_moderation_state) {
  $content_moderation_state
    ->realSave();
}