Add unique constraint as attribute on EntityWorkflowStepHold class

This commit is contained in:
Julie Lenaerts 2024-08-28 17:16:50 +02:00 committed by Julien Fastré
parent c1e5f4a57e
commit deb4bda16e
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -18,6 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table('chill_main_workflow_entity_step_hold')]
#[ORM\UniqueConstraint(name: 'chill_main_workflow_hold_unique_idx', columns: ['step_id', 'byUser_id'])]
class EntityWorkflowStepHold implements TrackCreationInterface
{
use TrackCreationTrait;
@ -35,33 +36,24 @@ class EntityWorkflowStepHold implements TrackCreationInterface
#[ORM\JoinColumn(nullable: false)]
private User $byUser;
public function __construct(EntityWorkflowStep $step, User $byUser)
{
$this->step = $step;
$this->byUser = $byUser;
}
public function getId(): ?int
{
return $this->id;
}
public function setId(?int $id): void
{
$this->id = $id;
}
public function getStep(): EntityWorkflowStep
{
return $this->step;
}
public function setStep(EntityWorkflowStep $step): void
{
$this->step = $step;
}
public function getByUser(): User
{
return $this->byUser;
}
public function setByUser(User $byUser): void
{
$this->byUser = $byUser;
}
}