Handle cases when there are multiple EntityWorkflows associated with one entity

This commit is contained in:
2024-07-15 18:58:08 +02:00
parent 31f842471a
commit 9e92ede16f
9 changed files with 31 additions and 25 deletions

View File

@@ -135,10 +135,10 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW
return false;
}
public function findByRelatedEntity(object $object): ?EntityWorkflow
public function findByRelatedEntity(object $object): array
{
if (!$object instanceof AccompanyingPeriodWorkEvaluationDocument) {
return null;
return [];
}
return $this->workflowRepository->findByRelatedEntity(AccompanyingPeriodWorkEvaluationDocument::class, $object->getId());