src/Entity/Account.php line 26
<?phpnamespace App\Entity;use App\Entity\AccountBlock;use ApiPlatform\Metadata\Get;use ApiPlatform\Metadata\Post;use Doctrine\DBAL\Types\Types;use Symfony\Component\Uid\Ulid;use Doctrine\ORM\Mapping as ORM;use App\Entity\CompletedDialogue;use ApiPlatform\Metadata\ApiResource;use App\Repository\AccountRepository;use Doctrine\Common\Collections\Collection;use Symfony\Bridge\Doctrine\Types\UlidType;use Doctrine\Common\Collections\ArrayCollection;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints as Assert;use Symfony\Component\Security\Core\User\UserInterface;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;#[ORM\Entity(repositoryClass: AccountRepository::class)]#[UniqueEntity('email')]class Account implements UserInterface, PasswordAuthenticatedUserInterface{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[Assert\NotBlank]#[Assert\Email]#[ORM\Column(length: 180, unique: true)]private ?string $email = null;#[ORM\Column(type: 'json')]private array $roles = [];#[ORM\Column]private ?\DateTimeImmutable $createdAt = null;#[ORM\Column]private ?bool $active = null;#[ORM\Column(length: 255, nullable: true)]private ?string $diocese = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $nextDialogue = null;#[ORM\Column(type: UlidType::NAME, unique: true, nullable: true)]private ?Ulid $hash = null;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $hashedAt = null;#[ORM\OneToMany(mappedBy: 'account', targetEntity: CompletedDialogue::class)]private Collection $completedDialogues;#[ORM\OneToMany(mappedBy: 'account', targetEntity: AccountBlock::class)]private Collection $accountBlocks;/*** @var string The hashed password*/#[ORM\Column]private ?string $password = null;private ?string $plainPassword = null;public function __construct(){$this->completedDialogues = new ArrayCollection();$this->accountBlocks = 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;}public function getPlainPassword(): ?string{return $this->plainPassword;}public function setPlainPassword(?string $plainPassword): self{$this->plainPassword = $plainPassword;return $this;}/*** @see UserInterface*/public function eraseCredentials(){// If you store any temporary, sensitive data on the user, clear it here// $this->plainPassword = null;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function isActive(): ?bool{return $this->active;}public function setActive(bool $active): self{$this->active = $active;return $this;}public function getDiocese(): ?string{return $this->diocese;}public function setDiocese(?string $diocese): self{$this->diocese = $diocese;return $this;}public function getNextDialogue(): ?\DateTimeInterface{return $this->nextDialogue;}public function setNextDialogue(?\DateTimeInterface $nextDialogue): self{$this->nextDialogue = $nextDialogue;return $this;}public function getHash(): ?Ulid{return $this->hash;}public function setHash(?Ulid $hash): self{$this->hash = $hash;return $this;}public function getHashedAt(): ?\DateTimeImmutable{return $this->hashedAt;}public function setHashedAt(?\DateTimeImmutable $hashedAt): static{$this->hashedAt = $hashedAt;return $this;}/*** @return Collection<int, CompletedDialogue>*/public function getCompletedDialogues(): Collection{return $this->completedDialogues;}public function addCompletedDialogue(CompletedDialogue $completedDialogue): self{if (!$this->completedDialogues->contains($completedDialogue)) {$this->completedDialogues->add($completedDialogue);$completedDialogue->setAccount($this);}return $this;}public function removeCompletedDialogue(CompletedDialogue $completedDialogue): self{if ($this->completedDialogues->removeElement($completedDialogue)) {// set the owning side to null (unless already changed)if ($completedDialogue->getAccount() === $this) {$completedDialogue->setAccount(null);}}return $this;}/*** @return Collection<int, AccountBlock>*/public function getAccountBlocks(): Collection{return $this->accountBlocks;}public function addAccountBlock(AccountBlock $accountBlock): self{if (!$this->accountBlocks->contains($accountBlock)) {$this->accountBlocks->add($accountBlock);$accountBlock->setAccount($this);}return $this;}public function removeAccountBlock(AccountBlock $accountBlock): self{if ($this->accountBlocks->removeElement($accountBlock)) {// set the owning side to null (unless already changed)if ($accountBlock->getAccount() === $this) {$accountBlock->setAccount(null);}}return $this;}}