You are here

public function ModerationInformation::getUnsupportedFeatures in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getUnsupportedFeatures()

Gets unsupported features for a given entity type.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to get the unsupported features for.

Return value

array An array of unsupported features for this entity type.

Overrides ModerationInformationInterface::getUnsupportedFeatures

File

core/modules/content_moderation/src/ModerationInformation.php, line 202

Class

ModerationInformation
General service for moderation-related questions about Entity API.

Namespace

Drupal\content_moderation

Code

public function getUnsupportedFeatures(EntityTypeInterface $entity_type) {
  $features = [];

  // Test if entity is publishable.
  if (!$entity_type
    ->entityClassImplements(EntityPublishedInterface::class)) {
    $features['publishing'] = $this
      ->t("@entity_type_plural_label do not support publishing statuses. For example, even after transitioning from a published workflow state to an unpublished workflow state they will still be visible to site visitors.", [
      '@entity_type_plural_label' => $entity_type
        ->getCollectionLabel(),
    ]);
  }
  return $features;
}