Fixed: [Activity] allow to set a user null

Fix https://gitlab.com/Chill-Projet/chill-bundles/-/issues/74
This commit is contained in:
2023-04-06 17:29:05 +02:00
parent 4d734714a8
commit cc69a3e86b
5 changed files with 22 additions and 18 deletions

View File

@@ -195,7 +195,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
* @Groups({"docgen:read"})
*/
private User $user;
private ?User $user;
/**
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
@@ -494,7 +494,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this->activityType;
}
public function getUser(): User
public function getUser(): ?User
{
return $this->user;
}
@@ -681,14 +681,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this;
}
public function setUser(UserInterface $user): self
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function setUsers(?Collection $users): self
public function setUsers(Collection $users): self
{
$this->users = $users;