src/Entity/UserDetails.php line 11

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