add basic context for AccompanyingPeriodWorkEvalution WIP

This commit is contained in:
2021-12-03 13:50:35 +01:00
parent e053529afb
commit 23eff9f6d4
7 changed files with 253 additions and 74 deletions

View File

@@ -1,5 +1,14 @@
<?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\PersonBundle\Service\DocGenerator;
use Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface;
@@ -17,10 +26,10 @@ class AccompanyingPeriodWorkContext implements
DocGeneratorContextWithAdminFormInterface,
DocGeneratorContextWithPublicFormInterface
{
private AccompanyingPeriodContext $periodContext;
private NormalizerInterface $normalizer;
private AccompanyingPeriodContext $periodContext;
public function __construct(
AccompanyingPeriodContext $periodContext,
NormalizerInterface $normalizer
@@ -29,6 +38,26 @@ class AccompanyingPeriodWorkContext implements
$this->normalizer = $normalizer;
}
public function adminFormReverseTransform(array $data): array
{
return $this->periodContext->adminFormReverseTransform($data);
}
public function adminFormTransform(array $data): array
{
return $this->periodContext->adminFormTransform($data);
}
public function buildAdminForm(FormBuilderInterface $builder): void
{
$this->periodContext->buildAdminForm($builder);
}
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
{
$this->periodContext->buildPublicForm($builder, $template, $entity);
}
/**
* @param AccompanyingPeriodWork $entity
*/
@@ -45,7 +74,7 @@ class AccompanyingPeriodWorkContext implements
public function getDescription(): string
{
return "A context for work";
return 'A context for work';
}
public function getEntityClass(): string
@@ -60,27 +89,7 @@ class AccompanyingPeriodWorkContext implements
public function getName(): string
{
return "Accompanying period work";
}
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
{
// TODO: Implement storeGenerated() method.
}
public function adminFormReverseTransform(array $data): array
{
return $this->periodContext->adminFormReverseTransform($data);
}
public function adminFormTransform(array $data): array
{
return $this->periodContext->adminFormTransform($data);
}
public function buildAdminForm(FormBuilderInterface $builder): void
{
$this->periodContext->buildAdminForm($builder);
return 'Accompanying period work';
}
public function hasAdminForm(): bool
@@ -88,13 +97,13 @@ class AccompanyingPeriodWorkContext implements
return $this->periodContext->hasAdminForm();
}
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
{
$this->periodContext->buildPublicForm($builder, $template, $entity);
}
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
{
return $this->periodContext->hasPublicForm($template, $entity);
}
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
{
// TODO: Implement storeGenerated() method.
}
}