mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Add unique constraint as attribute on EntityWorkflowStepHold class
This commit is contained in:
parent
c1e5f4a57e
commit
deb4bda16e
@ -18,6 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
|
|
||||||
#[ORM\Entity]
|
#[ORM\Entity]
|
||||||
#[ORM\Table('chill_main_workflow_entity_step_hold')]
|
#[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
|
class EntityWorkflowStepHold implements TrackCreationInterface
|
||||||
{
|
{
|
||||||
use TrackCreationTrait;
|
use TrackCreationTrait;
|
||||||
@ -35,33 +36,24 @@ class EntityWorkflowStepHold implements TrackCreationInterface
|
|||||||
#[ORM\JoinColumn(nullable: false)]
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
private User $byUser;
|
private User $byUser;
|
||||||
|
|
||||||
|
public function __construct(EntityWorkflowStep $step, User $byUser)
|
||||||
|
{
|
||||||
|
$this->step = $step;
|
||||||
|
$this->byUser = $byUser;
|
||||||
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setId(?int $id): void
|
|
||||||
{
|
|
||||||
$this->id = $id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getStep(): EntityWorkflowStep
|
public function getStep(): EntityWorkflowStep
|
||||||
{
|
{
|
||||||
return $this->step;
|
return $this->step;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setStep(EntityWorkflowStep $step): void
|
|
||||||
{
|
|
||||||
$this->step = $step;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getByUser(): User
|
public function getByUser(): User
|
||||||
{
|
{
|
||||||
return $this->byUser;
|
return $this->byUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setByUser(User $byUser): void
|
|
||||||
{
|
|
||||||
$this->byUser = $byUser;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user