diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStepHold.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStepHold.php index 166b8cfd2..47ae0f954 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStepHold.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStepHold.php @@ -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; - } }