src/Entity/User.php line 15
<?phpnamespace App\Entity;use App\Entity\Document;use App\Entity\Document\BlockCategory;use App\Repository\UserRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;use Symfony\Component\Security\Core\User\UserInterface;#[ORM\Entity(repositoryClass: UserRepository::class)]class User implements UserInterface, PasswordAuthenticatedUserInterface{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 180, unique: true)]private ?string $email = null;#[ORM\Column]private array $roles = [];/*** @var string The hashed password*/#[ORM\Column]private ?string $password = null;#[ORM\OneToMany(mappedBy: 'owner', targetEntity: DocxUploaded::class)]private Collection $docxUploadeds;#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Document::class)]private Collection $documents;#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Document::class)]private Collection $docs;#[ORM\OneToMany(mappedBy: 'user', targetEntity: DocumentPermission::class, orphanRemoval: true)]private Collection $documentPermissions;#[ORM\OneToMany(mappedBy: 'owner', targetEntity: BlockCategory::class)]private Collection $blockCategories;#[ORM\Column(length: 255, nullable: true)]private ?string $apikey = null;public function __construct(){$this->docxUploadeds = new ArrayCollection();$this->documents = new ArrayCollection();$this->docs = new ArrayCollection();$this->documentPermissions = new ArrayCollection();$this->blockCategories = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}/*** A visual identifier that represents this user.** @see UserInterface*/public function getUserIdentifier(): string{return (string) $this->email;}/*** @see UserInterface*/public function getRoles(): array{$roles = $this->roles;// guarantee every user at least has ROLE_USER$roles[] = 'ROLE_USER';return array_unique($roles);}public function setRoles(array $roles): self{$this->roles = $roles;return $this;}/*** @see PasswordAuthenticatedUserInterface*/public function getPassword(): string{return $this->password;}public function setPassword(string $password): self{$this->password = $password;return $this;}/*** @see UserInterface*/public function eraseCredentials(){// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}/*** @return Collection<int, DocxUploaded>*/public function getDocxUploadeds(): Collection{return $this->docxUploadeds;}public function addDocxUploaded(DocxUploaded $docxUploaded): self{if (!$this->docxUploadeds->contains($docxUploaded)) {$this->docxUploadeds->add($docxUploaded);$docxUploaded->setOwner($this);}return $this;}public function removeDocxUploaded(DocxUploaded $docxUploaded): self{if ($this->docxUploadeds->removeElement($docxUploaded)) {// set the owning side to null (unless already changed)if ($docxUploaded->getOwner() === $this) {$docxUploaded->setOwner(null);}}return $this;}/*** @return Collection<int, Document>*/public function getDocuments(): Collection{return $this->documents;}public function addDocument(Document $document): self{if (!$this->documents->contains($document)) {$this->documents->add($document);$document->setOwner($this);}return $this;}public function removeDocument(Document $document): self{if ($this->documents->removeElement($document)) {// set the owning side to null (unless already changed)if ($document->getOwner() === $this) {$document->setOwner(null);}}return $this;}/*** @return Collection<int, Document>*/public function getDocs(): Collection{return $this->docs;}public function addDoc(Document $doc): self{if (!$this->docs->contains($doc)) {$this->docs->add($doc);$doc->setOwner($this);}return $this;}public function removeDoc(Document $doc): self{if ($this->docs->removeElement($doc)) {// set the owning side to null (unless already changed)if ($doc->getOwner() === $this) {$doc->setOwner(null);}}return $this;}/*** @return Collection<int, DocumentPermission>*/public function getDocumentPermissions(): Collection{return $this->documentPermissions;}public function addDocumentPermission(DocumentPermission $documentPermission): self{if (!$this->documentPermissions->contains($documentPermission)) {$this->documentPermissions->add($documentPermission);$documentPermission->setUser($this);}return $this;}public function removeDocumentPermission(DocumentPermission $documentPermission): self{if ($this->documentPermissions->removeElement($documentPermission)) {// set the owning side to null (unless already changed)if ($documentPermission->getUser() === $this) {$documentPermission->setUser(null);}}return $this;}/*** @return Collection<int, BlockCategory>*/public function getBlockCategories(): Collection{return $this->blockCategories;}public function addBlockCategory(BlockCategory $blockCategory): static{if (!$this->blockCategories->contains($blockCategory)) {$this->blockCategories->add($blockCategory);$blockCategory->setOwner($this);}return $this;}public function removeBlockCategory(BlockCategory $blockCategory): static{if ($this->blockCategories->removeElement($blockCategory)) {// set the owning side to null (unless already changed)if ($blockCategory->getOwner() === $this) {$blockCategory->setOwner(null);}}return $this;}public function getApikey(): ?string{return $this->apikey;}public function setApikey(?string $apikey): static{$this->apikey = $apikey;return $this;}}