mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
generate context for evaluations
This commit is contained in:
@@ -34,7 +34,6 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
class AccompanyingPeriodContext implements
|
||||
DocGeneratorContextInterface,
|
||||
DocGeneratorContextWithAdminFormInterface,
|
||||
DocGeneratorContextWithPublicFormInterface
|
||||
{
|
||||
@@ -173,6 +172,13 @@ class AccompanyingPeriodContext implements
|
||||
return AccompanyingPeriod::class;
|
||||
}
|
||||
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array
|
||||
{
|
||||
return [
|
||||
'course' => $entity
|
||||
];
|
||||
}
|
||||
|
||||
public static function getKey(): string
|
||||
{
|
||||
return self::class;
|
||||
|
@@ -53,9 +53,12 @@ class AccompanyingPeriodWorkContext implements
|
||||
$this->periodContext->buildAdminForm($builder);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||
{
|
||||
$this->periodContext->buildPublicForm($builder, $template, $entity);
|
||||
$this->periodContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriod());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,6 +85,14 @@ class AccompanyingPeriodWorkContext implements
|
||||
return AccompanyingPeriodWork::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $entity
|
||||
*/
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array
|
||||
{
|
||||
return $this->periodContext->getFormData($template, $entity->getAccompanyingPeriod());
|
||||
}
|
||||
|
||||
public static function getKey(): string
|
||||
{
|
||||
return 'accompanying_period_work_regular';
|
||||
|
@@ -136,6 +136,15 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
||||
return AccompanyingPeriodWorkEvaluation::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||
*/
|
||||
public function getFormData(DocGeneratorTemplate $template, $entity): array
|
||||
{
|
||||
return $this->accompanyingPeriodWorkContext->getFormData($template,
|
||||
$entity->getAccompanyingPeriodWork());
|
||||
}
|
||||
|
||||
public static function getKey(): string
|
||||
{
|
||||
return 'accompanying_period_work_evaluation_regular';
|
||||
|
Reference in New Issue
Block a user