src/Entity/UserRegister.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRegisterRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassUserRegisterRepository::class)]
  7. class UserRegister
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column]
  14.     private ?int $user_id null;
  15.     #[ORM\OneToOne(mappedBy'register'targetEntityUser::class)]
  16.     protected User $user;
  17.     #[ORM\Column(length125nullabletrue)]
  18.     private ?string $registercode null;
  19.     #[ORM\Column(length125nullabletrue)]
  20.     private ?string $passwordcode null;
  21.     #[ORM\Column(length12nullabletrue)]
  22.     private ?string $code_time null;
  23.     #[ORM\Column(length12nullabletrue)]
  24.     private ?string $activated_time null;
  25.     #[ORM\Column]
  26.     private ?DateTimeImmutable $created_at null;
  27.     #[ORM\Column(options: ['default' => false])]
  28.     private ?bool $is_new null;
  29.     public function __construct()
  30.     {
  31.         $this->created_at = new DateTimeImmutable();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getUserId(): ?int
  38.     {
  39.         return $this->user_id;
  40.     }
  41.     public function setUserId(int $user_id): self
  42.     {
  43.         $this->user_id $user_id;
  44.         return $this;
  45.     }
  46.     public function getRegistercode(): ?string
  47.     {
  48.         return $this->registercode;
  49.     }
  50.     public function setRegistercode(?string $registercode): self
  51.     {
  52.         $this->registercode $registercode;
  53.         return $this;
  54.     }
  55.     public function getPasswordcode(): ?string
  56.     {
  57.         return $this->passwordcode;
  58.     }
  59.     public function setPasswordcode(?string $passwordcode): self
  60.     {
  61.         $this->passwordcode $passwordcode;
  62.         return $this;
  63.     }
  64.     public function getCodeTime(): ?string
  65.     {
  66.         return $this->code_time;
  67.     }
  68.     public function setCodeTime(?string $code_time): self
  69.     {
  70.         $this->code_time $code_time;
  71.         return $this;
  72.     }
  73.     public function getActivatedTime(): ?string
  74.     {
  75.         return $this->activated_time;
  76.     }
  77.     public function setActivatedTime(?string $activated_time): self
  78.     {
  79.         $this->activated_time $activated_time;
  80.         return $this;
  81.     }
  82.     public function getCreatedAt(): ?DateTimeImmutable
  83.     {
  84.         return $this->created_at;
  85.     }
  86.     public function setCreatedAt(DateTimeImmutable $created_at): self
  87.     {
  88.         $this->created_at $created_at;
  89.         return $this;
  90.     }
  91.     public function isIsNew(): ?bool
  92.     {
  93.         return $this->is_new;
  94.     }
  95.     public function setIsNew(bool $is_new): self
  96.     {
  97.         $this->is_new $is_new;
  98.         return $this;
  99.     }
  100.     public function getUser(): ?User
  101.     {
  102.         return $this->user;
  103.     }
  104.     public function setUser(?User $user): self
  105.     {
  106.         // unset the owning side of the relation if necessary
  107.         if ($user === null && $this->user !== null) {
  108.             $this->user->setRegister(null);
  109.         }
  110.         // set the owning side of the relation if necessary
  111.         if ($user !== null && $user->getRegister() !== $this) {
  112.             $user->setRegister($this);
  113.         }
  114.         $this->user $user;
  115.         return $this;
  116.     }
  117. }