You are here

public function ModerationInformation::isModeratableBundle in Workbench Moderation 8

Same name and namespace in other branches
  1. 8.2 src/ModerationInformation.php \Drupal\workbench_moderation\ModerationInformation::isModeratableBundle()

Determines if an entity type/bundle is one that will be moderated.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition to check.

string $bundle: The bundle to check.

Return value

bool TRUE if this is a bundle we want to moderate, FALSE otherwise.

Overrides ModerationInformationInterface::isModeratableBundle

1 call to ModerationInformation::isModeratableBundle()
ModerationInformation::isModeratableEntity in src/ModerationInformation.php
Determines if an entity is one we should be moderating.

File

src/ModerationInformation.php, line 81

Class

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

Namespace

Drupal\workbench_moderation

Code

public function isModeratableBundle(EntityTypeInterface $entity_type, $bundle) {
  if ($bundle_entity = $this
    ->loadBundleEntity($entity_type
    ->getBundleEntityType(), $bundle)) {
    return $bundle_entity
      ->getThirdPartySetting('workbench_moderation', 'enabled', FALSE);
  }
  return FALSE;
}