136 lines
2.7 KiB
PHP

<?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\DocGeneratorBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
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
{
/**
* 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;
/**
* 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 = [];
/**
* @ORM\Column(type="string", length=255)
*/
private string $file;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Groups({"read"})
*/
private int $id;
/**
* @ORM\Column(type="json")
* @Serializer\Groups({"read"})
*/
private array $name = [];
public function getContext(): ?string
{
return $this->context;
}
public function getDescription(): ?string
{
return $this->description;
}
public function getEntities(): ?array
{
return $this->entities;
}
public function getFile(): ?string
{
return $this->file;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?array
{
return $this->name;
}
public function setContext(string $context): self
{
$this->context = $context;
return $this;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function setEntities(array $entities): self
{
$this->entities = $entities;
return $this;
}
public function setFile(string $file): self
{
$this->file = $file;
return $this;
}
public function setName(array $name): self
{
$this->name = $name;
return $this;
}
}