You are here

public function WorkflowManager::getAllWorksflowByEntity in Forms Steps 8

Returns all workflow entries of the provided entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: Entity instance to get the workflow from.

Return value

array|null Returns an array of workflows if found, null otherwise.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to WorkflowManager::getAllWorksflowByEntity()
WorkflowManager::getWorkflowByEntity in src/Service/WorkflowManager.php
Returns the first workflow entry of the provided entity.

File

src/Service/WorkflowManager.php, line 108

Class

WorkflowManager
Class WorkflowManager.

Namespace

Drupal\forms_steps\Service

Code

public function getAllWorksflowByEntity(EntityInterface $entity) {
  return $this->entityTypeManager
    ->getStorage(Workflow::ENTITY_TYPE)
    ->loadByProperties([
    'entity_type' => $entity
      ->getEntityTypeId(),
    'bundle' => $entity
      ->bundle(),
    'entity_id' => $entity
      ->id(),
  ]);
}