Generate a context for docgen, on accompanying period

This commit is contained in:
2021-11-30 23:23:02 +01:00
parent 3404d3669c
commit de4e83b3fb
19 changed files with 433 additions and 128 deletions

View File

@@ -1,10 +1,18 @@
<?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;
use Chill\DocGeneratorBundle\Context\Exception\UnexpectedTypeException;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
@@ -12,16 +20,6 @@ class AccompanyingPeriodContext implements DocGeneratorContextInterface
{
public NormalizerInterface $normalizer;
public function getName(): string
{
return 'Accompanying Period';
}
public static function getKey(): string
{
return self::class;
}
public function getData($entity): array
{
if (!$entity instanceof AccompanyingPeriod) {
@@ -36,6 +34,16 @@ class AccompanyingPeriodContext implements DocGeneratorContextInterface
// TODO: Implement getForm() method.
}
public static function getKey(): string
{
return self::class;
}
public function getName(): string
{
return 'Accompanying Period';
}
public function hasForm(): bool
{
return false;
@@ -43,6 +51,6 @@ class AccompanyingPeriodContext implements DocGeneratorContextInterface
public function supports(string $entityClass): bool
{
return $entityClass === AccompanyingPeriod::class;
return AccompanyingPeriod::class === $entityClass;
}
}