105 worflow

This commit is contained in:
2022-01-24 13:17:46 +00:00
committed by Julien Fastré
parent daff4e4200
commit c7dbaae8d6
110 changed files with 5176 additions and 392 deletions

View File

@@ -0,0 +1,35 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\MainBundle\Workflow;
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface;
use Symfony\Component\Workflow\WorkflowInterface;
class RelatedEntityWorkflowSupportsStrategy implements WorkflowSupportStrategyInterface
{
public function supports(WorkflowInterface $workflow, $subject): bool
{
if (!$subject instanceof EntityWorkflow) {
return false;
}
foreach ($workflow->getMetadataStore()->getWorkflowMetadata()['related_entity']
as $relatedEntityClass) {
if ($subject->getRelatedEntityClass() === $relatedEntityClass) {
return true;
}
}
return false;
}
}