feat(workflow) : ajoute workflow requis sur Project (RESTRICT)

This commit is contained in:
2026-05-19 19:50:34 +02:00
parent 43e6d1aed2
commit 8a68e0d397

View File

@@ -69,6 +69,12 @@ class Project
#[Groups(['project:read', 'project:write'])]
private ?Client $client = null;
#[ORM\ManyToOne(targetEntity: Workflow::class)]
#[ORM\JoinColumn(nullable: false, onDelete: 'RESTRICT')]
#[Groups(['project:read', 'project:write', 'task:read'])]
#[Assert\NotNull(message: 'Un projet doit avoir un workflow.')]
private ?Workflow $workflow = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['project:read', 'project:write', 'task:read'])]
private ?string $giteaOwner = null;
@@ -228,6 +234,18 @@ class Project
return $this;
}
public function getWorkflow(): ?Workflow
{
return $this->workflow;
}
public function setWorkflow(Workflow $workflow): static
{
$this->workflow = $workflow;
return $this;
}
#[Groups(['project:read'])]
public function getTaskCount(): int
{