protected function QuickTransitionForm::getModerationState in Moderation Sidebar 8
Gets the Moderation State of a given Entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: An entity.
Return value
\Drupal\workflows\StateInterface The moderation state for the given entity.
1 call to QuickTransitionForm::getModerationState()
- QuickTransitionForm::buildForm in src/
Form/ QuickTransitionForm.php - Form constructor.
File
- src/
Form/ QuickTransitionForm.php, line 268
Class
- QuickTransitionForm
- The QuickTransitionForm provides quick buttons for changing transitions.
Namespace
Drupal\moderation_sidebar\FormCode
protected function getModerationState(ContentEntityInterface $entity) {
$state_id = $entity->moderation_state
->get(0)
->getValue()['value'];
$workflow = $this->moderationInformation
->getWorkFlowForEntity($entity);
return $workflow
->getTypePlugin()
->getState($state_id);
}