Merge remote-tracking branch 'origin/signature-app-master' into 286-storedobject-voter

This commit is contained in:
2024-07-16 13:34:36 +02:00
17 changed files with 326 additions and 41 deletions

View File

@@ -11,6 +11,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Workflow;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Chill\MainBundle\Workflow\Exception\HandlerNotFoundException;
use Symfony\Component\Workflow\Registry;
@@ -38,6 +39,17 @@ class EntityWorkflowManager
return $this->registry->all($entityWorkflow);
}
public function getAssociatedStoredObject(EntityWorkflow $entityWorkflow): ?StoredObject
{
foreach ($this->handlers as $handler) {
if ($handler instanceof EntityWorkflowWithStoredObjectHandlerInterface && $handler->supports($entityWorkflow)) {
return $handler->getAssociatedStoredObject($entityWorkflow);
}
}
return null;
}
/**
* @return list<EntityWorkflow>
*/