You are here

public static function ContentEntitySource::isModeratedEntity in Translation Management Tool 8

Determines whether an entity is moderated.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity.

Return value

bool TRUE if the entity is moderated. Otherwise, FALSE.

2 calls to ContentEntitySource::isModeratedEntity()
ContentEntitySource::doSaveTranslations in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Saves translation data in an entity translation.
ContentEntitySourcePluginUi::reviewForm in sources/content/src/ContentEntitySourcePluginUi.php
Form callback for the job item review form.

File

sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php, line 323

Class

ContentEntitySource
Content entity source plugin controller.

Namespace

Drupal\tmgmt_content\Plugin\tmgmt\Source

Code

public static function isModeratedEntity(EntityInterface $entity) {
  if (!\Drupal::moduleHandler()
    ->moduleExists('content_moderation')) {
    return FALSE;
  }
  return \Drupal::service('content_moderation.moderation_information')
    ->isModeratedEntity($entity);
}