src/Entity/UserDetails.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserDetailsRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassUserDetailsRepository::class)]
  7. class UserDetails
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     protected ?int $id null;
  13.     #[ORM\OneToOne(mappedBy'userdetails'targetEntityUser::class)]
  14.     protected User $user;
  15.     #[ORM\Column(nullabletrue)]
  16.     private ?int $img_id null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $register_ip null;
  19.     #[ORM\Column(length24nullabletrue)]
  20.     private ?string $title null;
  21.     #[ORM\Column(length64nullabletrue)]
  22.     private ?string $first_name null;
  23.     #[ORM\Column(length64nullabletrue)]
  24.     private ?string $last_name null;
  25.     #[ORM\Column(length128nullabletrue)]
  26.     private ?string $company null;
  27.     #[ORM\Column(length10nullabletrue)]
  28.     private ?string $zip null;
  29.     #[ORM\Column(length125nullabletrue)]
  30.     private ?string $country null;
  31.     #[ORM\Column(length125nullabletrue)]
  32.     private ?string $street null;
  33.     #[ORM\Column(length12nullabletrue)]
  34.     private ?string $hnr null;
  35.     #[ORM\Column(length64nullabletrue)]
  36.     private ?string $phone null;
  37.     #[ORM\Column(length64nullabletrue)]
  38.     private ?string $mobil null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $notiz null;
  41.     #[ORM\Column]
  42.     private ?DateTimeImmutable $created_at null;
  43.     #[ORM\Column]
  44.     private ?bool $change_pw null;
  45.     #[ORM\Column]
  46.     private ?bool $aktiv null;
  47.     #[ORM\Columnoptions: ['default' => false])]
  48.     private ?bool $must_validated null;
  49.     public function __construct()
  50.     {
  51.         $this->created_at = new DateTimeImmutable();
  52.     }
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getImgId(): ?int
  58.     {
  59.         return $this->img_id;
  60.     }
  61.     public function setImgId(?int $img_id): self
  62.     {
  63.         $this->img_id $img_id;
  64.         return $this;
  65.     }
  66.     public function getRegisterIp(): ?string
  67.     {
  68.         return $this->register_ip;
  69.     }
  70.     public function setRegisterIp(?string $register_ip): self
  71.     {
  72.         $this->register_ip $register_ip;
  73.         return $this;
  74.     }
  75.     public function getTitle(): ?string
  76.     {
  77.         return $this->title;
  78.     }
  79.     public function setTitle(?string $title): self
  80.     {
  81.         $this->title $title;
  82.         return $this;
  83.     }
  84.     public function getFirstName(): ?string
  85.     {
  86.         return $this->first_name;
  87.     }
  88.     public function setFirstName(?string $first_name): self
  89.     {
  90.         $this->first_name $first_name;
  91.         return $this;
  92.     }
  93.     public function getLastName(): ?string
  94.     {
  95.         return $this->last_name;
  96.     }
  97.     public function setLastName(?string $last_name): self
  98.     {
  99.         $this->last_name $last_name;
  100.         return $this;
  101.     }
  102.     public function getCompany(): ?string
  103.     {
  104.         return $this->company;
  105.     }
  106.     public function setCompany(?string $company): self
  107.     {
  108.         $this->company $company;
  109.         return $this;
  110.     }
  111.     public function getZip(): ?string
  112.     {
  113.         return $this->zip;
  114.     }
  115.     public function setZip(?string $zip): self
  116.     {
  117.         $this->zip $zip;
  118.         return $this;
  119.     }
  120.     public function getCountry(): ?string
  121.     {
  122.         return $this->country;
  123.     }
  124.     public function setCountry(?string $country): self
  125.     {
  126.         $this->country $country;
  127.         return $this;
  128.     }
  129.     public function getStreet(): ?string
  130.     {
  131.         return $this->street;
  132.     }
  133.     public function setStreet(?string $street): self
  134.     {
  135.         $this->street $street;
  136.         return $this;
  137.     }
  138.     public function getHnr(): ?string
  139.     {
  140.         return $this->hnr;
  141.     }
  142.     public function setHnr(?string $hnr): self
  143.     {
  144.         $this->hnr $hnr;
  145.         return $this;
  146.     }
  147.     public function getPhone(): ?string
  148.     {
  149.         return $this->phone;
  150.     }
  151.     public function setPhone(?string $phone): self
  152.     {
  153.         $this->phone $phone;
  154.         return $this;
  155.     }
  156.     public function getMobil(): ?string
  157.     {
  158.         return $this->mobil;
  159.     }
  160.     public function setMobil(?string $mobil): self
  161.     {
  162.         $this->mobil $mobil;
  163.         return $this;
  164.     }
  165.     public function getNotiz(): ?string
  166.     {
  167.         return $this->notiz;
  168.     }
  169.     public function setNotiz(?string $notiz): self
  170.     {
  171.         $this->notiz $notiz;
  172.         return $this;
  173.     }
  174.     public function getCreatedAt(): ?DateTimeImmutable
  175.     {
  176.         return $this->created_at;
  177.     }
  178.     public function setCreatedAt(DateTimeImmutable $created_at): self
  179.     {
  180.         $this->created_at $created_at;
  181.         return $this;
  182.     }
  183.   /* public function __toString()
  184.     {
  185.         $format = "UserDetails (id: %s, user_id: %s, register_ip: %s, street: %s, city: %s, country: %s)";
  186.         return sprintf($format, $this->id, $this->user_id,$this->register_ip, $this->street, $this->country);
  187.     }*/
  188.    public function getUser(): ?User
  189.    {
  190.        return $this->user;
  191.    }
  192.    public function setUser(?User $user): self
  193.    {
  194.        // unset the owning side of the relation if necessary
  195.        if ($user === null) {
  196.            $this->user->setUserdetails(null);
  197.        }
  198.        // set the owning side of the relation if necessary
  199.        if ($user !== null && $user->getUserdetails() !== $this) {
  200.            $user->setUserdetails($this);
  201.        }
  202.        $this->user $user;
  203.        return $this;
  204.    }
  205.    public function isChangePw(): ?bool
  206.    {
  207.        return $this->change_pw;
  208.    }
  209.    public function setChangePw(bool $change_pw): self
  210.    {
  211.        $this->change_pw $change_pw;
  212.        return $this;
  213.    }
  214.    public function isAktiv(): ?bool
  215.    {
  216.        return $this->aktiv;
  217.    }
  218.    public function setAktiv(bool $aktiv): self
  219.    {
  220.        $this->aktiv $aktiv;
  221.        return $this;
  222.    }
  223.    public function isMustValidated(): ?bool
  224.    {
  225.        return $this->must_validated;
  226.    }
  227.    public function setMustValidated(?bool $must_validated): self
  228.    {
  229.        $this->must_validated $must_validated;
  230.        return $this;
  231.    }
  232. }