You are here

protected function StateTransitionValidation::loadBundleEntity in Workbench Moderation 8

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

Loads a specific bundle entity.

Parameters

string $bundle_entity_type_id: The bundle entity type ID.

string $bundle_id: The bundle ID.

Return value

\Drupal\Core\Config\Entity\ConfigEntityInterface|null Returns the bundle entity of a given entity type.

2 calls to StateTransitionValidation::loadBundleEntity()
StateTransitionValidation::getValidTransitions in src/StateTransitionValidation.php
Gets a list of transitions that are legal for this user on this entity.
StateTransitionValidation::getValidTransitionTargets in src/StateTransitionValidation.php
Gets a list of states a user may transition an entity to.

File

src/StateTransitionValidation.php, line 273

Class

StateTransitionValidation
Validates whether a certain state transition is allowed.

Namespace

Drupal\workbench_moderation

Code

protected function loadBundleEntity($bundle_entity_type_id, $bundle_id) {
  if ($bundle_entity_type_id) {
    return $this->entityTypeManager
      ->getStorage($bundle_entity_type_id)
      ->load($bundle_id);
  }
}