add form to doc generation and custom form to admin template configuration

This commit is contained in:
2021-12-01 23:00:02 +01:00
parent 7719d2b073
commit 475b40e896
15 changed files with 484 additions and 108 deletions

View File

@@ -24,6 +24,11 @@ use Symfony\Component\Serializer\Annotation as Serializer;
*/
class DocGeneratorTemplate
{
/**
* @ORM\Column(type="boolean", options={"default":true})
*/
private bool $active = true;
/**
* Class name of the context to use.
*
@@ -38,20 +43,24 @@ class DocGeneratorTemplate
* @ORM\Column(type="text", nullable=true)
* @Serializer\Groups({"read"})
*/
private string $description;
private ?string $description = null;
/**
* Class name of the entities for which this template can be used.
* Class name of the entity 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")
* @ORM\Column(type="string", options={"default":""})
*/
private array $entities = [];
private string $entity = "";
/**
* @ORM\ManyToOne(targetEntity=StoredObject::class, cascade={"persist"}).)
* Options for the template
*
* @ORM\Column(type="json", name="template_options", options={"default":"[]"})
*/
private array $options = [];
/**
* @ORM\ManyToOne(targetEntity=StoredObject::class, cascade={"persist"}))
*/
private ?StoredObject $file = null;
@@ -69,6 +78,18 @@ class DocGeneratorTemplate
*/
private array $name = [];
public function isActive(): bool
{
return $this->active;
}
public function setActive(bool $active): DocGeneratorTemplate
{
$this->active = $active;
return $this;
}
public function getContext(): ?string
{
return $this->context;
@@ -79,11 +100,6 @@ class DocGeneratorTemplate
return $this->description;
}
public function getEntities(): ?array
{
return $this->entities;
}
public function getFile(): ?StoredObject
{
return $this->file;
@@ -113,13 +129,6 @@ class DocGeneratorTemplate
return $this;
}
public function setEntities(array $entities): self
{
$this->entities = $entities;
return $this;
}
public function setFile(StoredObject $file): self
{
$this->file = $file;
@@ -133,4 +142,28 @@ class DocGeneratorTemplate
return $this;
}
public function getEntity(): string
{
return $this->entity;
}
public function setEntity(string $entity): self
{
$this->entity = $entity;
return $this;
}
public function getOptions(): array
{
return $this->options;
}
public function setOptions(array $options): self
{
$this->options = $options;
return $this;
}
}