public function ModerationInformation::getWorkflowForEntity in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/ModerationInformation.php \Drupal\content_moderation\ModerationInformation::getWorkflowForEntity()
Gets the workflow for the given content entity.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity to get the workflow for.
Return value
\Drupal\workflows\WorkflowInterface|null The workflow entity. NULL if there is no workflow.
Overrides ModerationInformationInterface::getWorkflowForEntity
2 calls to ModerationInformation::getWorkflowForEntity()
- ModerationInformation::isDefaultRevisionPublished in core/
modules/ content_moderation/ src/ ModerationInformation.php - Determines if the default revision for the given entity is published.
- ModerationInformation::isLiveRevision in core/
modules/ content_moderation/ src/ ModerationInformation.php - Determines if an entity is "live".
File
- core/
modules/ content_moderation/ src/ ModerationInformation.php, line 184
Class
- ModerationInformation
- General service for moderation-related questions about Entity API.
Namespace
Drupal\content_moderationCode
public function getWorkflowForEntity(ContentEntityInterface $entity) {
return $this
->getWorkflowForEntityTypeAndBundle($entity
->getEntityTypeId(), $entity
->bundle());
}