DocGeneratorTemplate use StoredObject for storign the template

This commit is contained in:
Marc Ducobu
2021-11-05 14:53:51 +01:00
committed by marcu
parent a3da9c538c
commit 7fe2172f05
6 changed files with 84 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ namespace Chill\DocGeneratorBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Chill\DocStoreBundle\Entity\StoredObject;
/**
* @ORM\Entity
@@ -46,9 +47,9 @@ class DocGeneratorTemplate
private array $entities = [];
/**
* @ORM\Column(type="string", length=255)
* @ORM\ManyToOne(targetEntity=StoredObject::class, cascade={"persist"}).)
*/
private string $file;
private ?StoredObject $file = null;
/**
* @ORM\Id
@@ -57,6 +58,7 @@ class DocGeneratorTemplate
* @Serializer\Groups({"read"})
*/
private int $id;
/**
* @ORM\Column(type="json")
@@ -79,7 +81,7 @@ class DocGeneratorTemplate
return $this->entities;
}
public function getFile(): ?string
public function getFile(): ?StoredObject
{
return $this->file;
}
@@ -89,10 +91,11 @@ class DocGeneratorTemplate
return $this->id;
}
public function getName(): ?array
public function getName(): ?array
{
return $this->name;
}
public function setContext(string $context): self
{
@@ -115,7 +118,7 @@ class DocGeneratorTemplate
return $this;
}
public function setFile(string $file): self
public function setFile(StoredObject $file): self
{
$this->file = $file;