mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Merge branch 'signature-app/wp-706-no-forward-unless-signed' into 'signature-app-master'
Block transition if there is a pending signature for the entityWorkflow See merge request Chill-Projet/chill-bundles!736
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
namespace Chill\PersonBundle\Security\CenterResolver;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverInterface;
|
||||
use Chill\MainBundle\Security\Resolver\ManagerAwareCenterResolverInterface;
|
||||
use Chill\MainBundle\Security\Resolver\ManagerAwareCenterResolverTrait;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument;
|
||||
|
||||
final class AccompanyingPeriodWorkEvaluationDocumentCenterResolver implements CenterResolverInterface, ManagerAwareCenterResolverInterface
|
||||
{
|
||||
use ManagerAwareCenterResolverTrait;
|
||||
|
||||
public static function getDefaultPriority(): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function resolveCenter($entity, ?array $options = []): Center|array
|
||||
{
|
||||
/* @var $entity AccompanyingPeriodWorkEvaluationDocument */
|
||||
return $this->centerResolverManager->resolveCenters($entity->getAccompanyingPeriodWorkEvaluation()
|
||||
->getAccompanyingPeriodWork()->getAccompanyingPeriod(), $options);
|
||||
}
|
||||
|
||||
public function supports($entity, ?array $options = []): bool
|
||||
{
|
||||
return $entity instanceof AccompanyingPeriodWorkEvaluationDocument;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user