/** * @param string|Workflow|WorkflowItem|WorkflowDefinition $workflowIdentifier */ public function activateWorkflow($workflowIdentifier) { if ($workflowIdentifier instanceof WorkflowDefinition) { $entityClass = $workflowIdentifier->getRelatedEntity(); $workflowName = $workflowIdentifier->getName(); } else { $workflow = $this->getWorkflow($workflowIdentifier); $entityClass = $workflow->getDefinition()->getRelatedEntity(); $workflowName = $workflow->getName(); } $this->setActiveWorkflow($entityClass, $workflowName); }