mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Feature: Add new field ccuser in workflow step entity
This commit is contained in:
@@ -32,6 +32,12 @@ class EntityWorkflowStep
|
||||
*/
|
||||
private string $accessKey;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
* @ORM\JoinTable(name="chill_main_workflow_entity_step_cc_user")
|
||||
*/
|
||||
private Collection $ccUser;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
@@ -114,6 +120,7 @@ class EntityWorkflowStep
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->ccUser = new ArrayCollection();
|
||||
$this->destUser = new ArrayCollection();
|
||||
$this->destUserByAccessKey = new ArrayCollection();
|
||||
$this->accessKey = bin2hex(openssl_random_pseudo_bytes(32));
|
||||
@@ -128,6 +135,15 @@ class EntityWorkflowStep
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addCcUser(User $user): self
|
||||
{
|
||||
if (!$this->ccUser->contains($user)) {
|
||||
$this->ccUser[] = $user;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addDestUser(User $user): self
|
||||
{
|
||||
if (!$this->destUser->contains($user)) {
|
||||
@@ -167,6 +183,11 @@ class EntityWorkflowStep
|
||||
);
|
||||
}
|
||||
|
||||
public function getCcUser(): Collection
|
||||
{
|
||||
return $this->ccUser;
|
||||
}
|
||||
|
||||
public function getComment(): string
|
||||
{
|
||||
return $this->comment;
|
||||
@@ -261,6 +282,13 @@ class EntityWorkflowStep
|
||||
return true;
|
||||
}
|
||||
|
||||
public function removeCcUser(User $user): self
|
||||
{
|
||||
$this->ccUser->removeElement($user);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeDestEmail(string $email): self
|
||||
{
|
||||
$this->destEmail = array_filter($this->destEmail, static function (string $existing) use ($email) {
|
||||
|
Reference in New Issue
Block a user