Fix config
This commit is contained in:
@@ -75,32 +75,14 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
private ?array $accessTokenScopes = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'employees')]
|
||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
||||
#[Groups(['user:read'])]
|
||||
private ?Company $company = null;
|
||||
|
||||
#[Groups(['user:write'])]
|
||||
#[SerializedName('password')]
|
||||
#[Assert\NotBlank(groups: ['postValidation'])]
|
||||
private ?string $plainPassword = null;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'ownedBy', targetEntity: Project::class)]
|
||||
#[Groups(['user:read'])]
|
||||
private Collection $projects;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'postedBy', targetEntity: Comment::class)]
|
||||
private Collection $comments;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: Folder::class)]
|
||||
private Collection $folders;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->apiTokens = new ArrayCollection();
|
||||
$this->projects = new ArrayCollection();
|
||||
$this->comments = new ArrayCollection();
|
||||
$this->folders = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -250,18 +232,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
$this->accessTokenScopes = $scopes;
|
||||
}
|
||||
|
||||
public function getCompany(): ?Company
|
||||
{
|
||||
return $this->company;
|
||||
}
|
||||
|
||||
public function setCompany(?Company $company): static
|
||||
{
|
||||
$this->company = $company;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPlainPassword(): ?string
|
||||
{
|
||||
return $this->plainPassword;
|
||||
@@ -271,94 +241,4 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
$this->plainPassword = $plainPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Project>
|
||||
*/
|
||||
public function getProjects(): Collection
|
||||
{
|
||||
return $this->projects;
|
||||
}
|
||||
|
||||
public function addProject(Project $project): static
|
||||
{
|
||||
if (!$this->projects->contains($project)) {
|
||||
$this->projects->add($project);
|
||||
$project->setOwnedBy($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeProject(Project $project): static
|
||||
{
|
||||
if ($this->projects->removeElement($project)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($project->getOwnedBy() === $this) {
|
||||
$project->setOwnedBy(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Comment>
|
||||
*/
|
||||
public function getComments(): Collection
|
||||
{
|
||||
return $this->comments;
|
||||
}
|
||||
|
||||
public function addComment(Comment $comment): static
|
||||
{
|
||||
if (!$this->comments->contains($comment)) {
|
||||
$this->comments->add($comment);
|
||||
$comment->setPostedBy($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeComment(Comment $comment): static
|
||||
{
|
||||
if ($this->comments->removeElement($comment)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($comment->getPostedBy() === $this) {
|
||||
$comment->setPostedBy(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Folder>
|
||||
*/
|
||||
public function getFolders(): Collection
|
||||
{
|
||||
return $this->folders;
|
||||
}
|
||||
|
||||
public function addFolder(Folder $folder): static
|
||||
{
|
||||
if (!$this->folders->contains($folder)) {
|
||||
$this->folders->add($folder);
|
||||
$folder->setCreatedBy($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFolder(Folder $folder): static
|
||||
{
|
||||
if ($this->folders->removeElement($folder)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($folder->getCreatedBy() === $this) {
|
||||
$folder->setCreatedBy(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user