mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Add attachments to workflow
This commit is contained in:
@@ -46,9 +46,10 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
|
||||
#[ORM\ManyToOne(targetEntity: DocGeneratorTemplate::class)]
|
||||
private ?DocGeneratorTemplate $template = null;
|
||||
|
||||
#[Assert\Length(min: 2, max: 250)]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||
private string $title = '';
|
||||
/**
|
||||
* Store the title of the document, if the title is set before the document.
|
||||
*/
|
||||
private string $proxyTitle = '';
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: \Chill\MainBundle\Entity\User::class)]
|
||||
private ?\Chill\MainBundle\Entity\User $user = null;
|
||||
@@ -78,9 +79,10 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
#[Assert\Length(min: 2, max: 250)]
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
return (string) $this->getObject()?->getTitle();
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
@@ -113,6 +115,10 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
$this->object = $object;
|
||||
|
||||
if ('' !== $this->proxyTitle) {
|
||||
$this->object->setTitle($this->proxyTitle);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -125,7 +131,11 @@ class Document implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
public function setTitle(string $title): self
|
||||
{
|
||||
$this->title = $title;
|
||||
if (null !== $this->getObject()) {
|
||||
$this->getObject()->setTitle($title);
|
||||
} else {
|
||||
$this->proxyTitle = $title;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user