/
var
/
www
/
html
/
restaurants
/
src
/
Document
/
Upload File
HOME
<?php namespace App\Document; use Symfony\Component\Security\Core\User\UserInterface; use Doctrine\Bundle\MongoDBBundle\Validator\Constraints\Unique as MongoDBUnique; use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; use Symfony\Component\Validator\Constraints as Assert; /** * @MongoDB\Document(collection="place_users") * @MongoDBUnique(fields="email") */ class User implements UserInterface { /** * @MongoDB\Id * @var int */ private $id; /** * @MongoDB\Field(type="string") * @var string */ private $email; /** * @MongoDB\Field(type="string") * @var string */ private $name; /** * @MongoDB\Field(type="collection") * @var array */ private $roles = []; /** * @var string The hashed password * @MongoDB\Field(type="string") */ private $password; /** * @MongoDB\Field(type="string") * @var string */ private $verification; /** * @MongoDB\Field(type="string") * @var string */ private $reset; /** * @MongoDB\Field(type="string") * @Assert\NotBlank() * @var string */ private $telephone; /** * @MongoDB\Field(type="bool") * @var bool */ private $enabled = false; /** * @var string * * @MongoDB\Field(type="string") */ private $created; /** * @var string * * @MongoDB\Field(type="string") */ private $modified; /** * @MongoDB\Field(type="int") */ private $subscription; /** * @MongoDB\Field(type="string") * @var string * Paystack Customer Code */ private $paystack_code; /** * @MongoDB\Field(type="string") * @var string */ private $paystack_auth; /** * @return int|null */ public function getId(): ?int { return $this->id; } /** * @return string|null */ public function getEmail(): ?string { return $this->email; } /** * @param string $email * @return self */ public function setEmail(string $email): self { $this->email = $email; return $this; } /** * @return string|null */ public function getName(): ?string { return $this->name; } /** * @param string $name * @return self */ public function setName(string $name): self { $this->name = $name; return $this; } /** * A visual identifier that represents this user. * @return string * @see UserInterface */ public function getUsername(): string { return (string) $this->email; } /** * @see UserInterface * @return array */ public function getRoles(): array { $roles = $this->roles; // guarantee every user at least has ROLE_USER $roles[] = 'ROLE_USER'; return array_unique($roles); } /** * @param array $roles * @return self */ public function setRoles(array $roles): self { $this->roles = count($roles) ? $roles : ['ROLE_USER']; return $this; } /** * @see UserInterface * @return string */ public function getPassword(): string { return (string) $this->password; } public function setPassword(string $password): self { $this->password = $password; return $this; } /** * @see UserInterface */ public function getSalt() { // not needed when using the "bcrypt" algorithm in security.yaml } /** * @see UserInterface */ public function eraseCredentials() { // If you store any temporary, sensitive data on the user, clear it here // $this->plainPassword = null; } /** * * @return string|null */ public function getVerification(): ?string { return $this->verification; } /** * * @param string|null $verification * @return self */ public function setVerification(?string $verification): self { $this->verification = $verification; return $this; } /** * @return string|null */ public function getReset(): ?string { return $this->reset; } /** * * @param string|null $reset * @return self */ public function setReset(?string $reset): self { $this->reset = $reset; return $this; } /** * * @return string|null */ public function getTelephone(): ?string { return $this->telephone; } /** * * @param string $telephone * @return self */ public function setTelephone(string $telephone): self { $this->telephone = $telephone; return $this; } /** * * @return bool|null */ public function getEnabled(): ?bool { return $this->enabled; } /** * * @param bool $enabled * @return self */ public function setEnabled(bool $enabled): self { $this->enabled = $enabled; return $this; } /** * * @return string|null */ public function getCreated(): ?string { return $this->created; } /** * @param string $created * @return self */ public function setCreated(string $created): self { $this->created = $created; return $this; } /** * * @return string|null */ public function getModified(): ?string { return $this->modified; } /** * * @param string $modified * @return self */ public function setModified(string $modified): self { $this->modified = $modified; return $this; } /** * * @return Subscription|null */ public function getSubscription(): ?Subscription { return $this->subscription; } /** * * @param $subscription * @return self */ public function setSubscription($subscription): self { $this->subscription = $subscription; return $this; } /** * @return string|null */ public function getPaystackCode(): ?string { return $this->paystack_code; } /** * @param string $paystack_code * @return self */ public function setPaystackCode(string $paystack_code): self { $this->paystack_code = $paystack_code; return $this; } /** * @return string|null */ public function getPaystackAuth(): ?string { return $this->paystack_auth; } /** * @param string $paystack_auth * @return self */ public function setPaystackAuth(string $paystack_auth): self { $this->paystack_auth = $paystack_auth; return $this; } }