mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
continue context for evaluations
This commit is contained in:
@@ -23,6 +23,8 @@ use Chill\PersonBundle\Repository\SocialWork\EvaluationRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationContext implements
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
@@ -34,17 +36,21 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
|
||||
private EvaluationRepository $evaluationRepository;
|
||||
|
||||
private NormalizerInterface $normalizer;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext,
|
||||
EntityManagerInterface $em,
|
||||
EvaluationRepository $evaluationRepository,
|
||||
NormalizerInterface $normalizer,
|
||||
TranslatableStringHelperInterface $translatableStringHelper
|
||||
) {
|
||||
$this->accompanyingPeriodWorkContext = $accompanyingPeriodWorkContext;
|
||||
$this->em = $em;
|
||||
$this->evaluationRepository = $evaluationRepository;
|
||||
$this->normalizer = $normalizer;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
@@ -92,14 +98,32 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
* @return void
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||
{
|
||||
// TODO: Implement buildPublicForm() method.
|
||||
$this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||
{
|
||||
// TODO: Implement getData() method.
|
||||
$data = $this->accompanyingPeriodWorkContext
|
||||
->getData($template, $entity->getAccompanyingPeriodWork(), $contextGenerationData);
|
||||
$data['evaluation'] = $this->normalizer->normalize(
|
||||
$entity,
|
||||
'docgen',
|
||||
[
|
||||
'docgen:expect' => AccompanyingPeriodWorkEvaluation::class,
|
||||
AbstractNormalizer::GROUPS => ['docgen:read'],
|
||||
]
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
@@ -127,9 +151,13 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
||||
{
|
||||
// TODO: Implement hasPublicForm() method.
|
||||
return $this->accompanyingPeriodWorkContext
|
||||
->hasPublicForm($template, $entity->getAccompanyingPeriodWork());
|
||||
}
|
||||
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||
|
Reference in New Issue
Block a user