resolve data Transformer in ActivityType (persons/thirdparties/users)

This commit is contained in:
2021-06-01 13:49:50 +02:00
parent e95d756e71
commit 9ab032c943
2 changed files with 58 additions and 45 deletions

View File

@@ -130,13 +130,13 @@ class Activity implements HasCenterInterface, HasScopeInterface
* @ORM\ManyToMany(targetEntity="Chill\PersonBundle\Entity\Person")
* @Groups({"read"})
*/
private Collection $persons;
private ?Collection $persons = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty")
* @Groups({"read"})
*/
private Collection $thirdParties;
private ?Collection $thirdParties = null;
/**
* @ORM\ManyToMany(targetEntity="Chill\DocStoreBundle\Entity\StoredObject")
@@ -147,7 +147,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"read"})
*/
private Collection $users;
private ?Collection $users = null;
/**
* @ORM\Column(type="boolean", options={"default"=false})
@@ -351,17 +351,18 @@ class Activity implements HasCenterInterface, HasScopeInterface
return $this->persons;
}
public function setPersons(Collection $persons): self
public function setPersons(?Collection $persons): self
{
$this->persons = $persons;
return $this;
}
public function addThirdParty(ThirdParty $thirdParty): self
public function addThirdParty(?ThirdParty $thirdParty): self
{
$this->thirdParties[] = $thirdParty;
if (null !== $thirdParty) {
$this->thirdParties[] = $thirdParty;
}
return $this;
}
@@ -375,7 +376,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
return $this->thirdParties;
}
public function setThirdParties(Collection $thirdParties): self
public function setThirdParties(?Collection $thirdParties): self
{
$this->thirdParties = $thirdParties;
@@ -406,10 +407,11 @@ class Activity implements HasCenterInterface, HasScopeInterface
return $this;
}
public function addUser(User $user): self
public function addUser(?User $user): self
{
$this->users[] = $user;
if (null !== $user) {
$this->users[] = $user;
}
return $this;
}
@@ -423,7 +425,7 @@ class Activity implements HasCenterInterface, HasScopeInterface
return $this->users;
}
public function setUsers(Collection $users): self
public function setUsers(?Collection $users): self
{
$this->users = $users;