docgen: improve listing for templates

This commit is contained in:
2021-11-27 01:23:34 +01:00
parent 69e260f0b1
commit 1c18ba20fc
3 changed files with 60 additions and 26 deletions

View File

@@ -15,31 +15,35 @@ use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Entity
* @ORM\Table(name="chill_docgen_template")
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
* "docgen_template": DocGeneratorTemplate::class
* })
*/
class DocGeneratorTemplate
{
/**
* @ORM\Column(type="string", length=255)
*
* Class name of the context to use
* Class name of the context to use.
*
* so if $context = ''
* this template will use '' as context
*
* @ORM\Column(type="string", length=255)
*/
private string $context;
/**
* @ORM\Column(type="text", nullable=true)
* @Serializer\Groups({"read"})
*/
private string $description;
/**
* @ORM\Column(type="simple_array")
*
* Class name of the entities for which this template can be used
* Class name of the entities for which this template can be used.
*
* so if $entities = ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction']
* this template can be selected for an AccompanyingPeriod or a SocialAction
*
* @ORM\Column(type="simple_array")
*/
private array $entities = [];