src/Entity/Client.php line 16

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="client")
  11.  */
  12. class Client
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\Column(type="integer", options={"unsigned":true})
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     protected $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, nullable=true)
  22.      */
  23.     private ?string $phone null;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     private ?string $password null;
  28.     /**
  29.      * @ORM\Column(type="string", length=30)
  30.      */
  31.     private ?string $userNumber null;
  32.     /**
  33.      * @ORM\Column(type="string", length=60, nullable=true)
  34.      */
  35.     private ?string $firstName null;
  36.     /**
  37.      * @ORM\Column(type="string", length=60, nullable=true)
  38.      */
  39.     private ?string $lastName null;
  40.     /**
  41.      * @ORM\Column(type="string", length=60, nullable=true)
  42.      */
  43.     private ?string $middleName null;
  44.     /**
  45.      * @ORM\Column(type="datetime", nullable=true)
  46.      */
  47.     private ?DateTime $dateOfBirth null;
  48.     /**
  49.      * @ORM\Column(type="string", length=30, nullable=true)
  50.      */
  51.     private ?string $passportNumber null;
  52.     /**
  53.      * @ORM\Column(type="string", length=60, nullable=true)
  54.      */
  55.     private ?string $passportId null;
  56.     /**
  57.      * @ORM\Column(type="datetime", nullable=true)
  58.      */
  59.     private ?DateTime $passportIssueDate null;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private ?string $passportIssuingAuthority null;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private ?string $registrationAddress null;
  68.     /**
  69.      * @ORM\Column(type="string", length=30, nullable=true)
  70.      */
  71.     private ?string $driversLicenseNumber null;
  72.     /**
  73.      * @ORM\Column(type="datetime", nullable=true)
  74.      */
  75.     private ?DateTime $driversLicenseDate null;
  76.     /**
  77.      * @ORM\Column(type="datetime", nullable=true)
  78.      */
  79.     private ?DateTime $dateSigningContract null;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity=Reserve::class, mappedBy="client")
  82.      */
  83.     private Collection $reserves;
  84.     /**
  85.      * @ORM\Column(type="text", nullable=true)
  86.      */
  87.     private $notes;
  88.     public function __construct()
  89.     {
  90.         $this->reserves =  new ArrayCollection();
  91.     }
  92.     public function getUserNumber(): ?string
  93.     {
  94.         return $this->userNumber;
  95.     }
  96.     public function setUserNumber(?string $userNumber): void
  97.     {
  98.         $this->userNumber $userNumber;
  99.     }
  100.     public function getPhone(): ?string
  101.     {
  102.         return $this->phone;
  103.     }
  104.     public function setPhone(?string $phone): void
  105.     {
  106.         $this->phone $phone;
  107.     }
  108.     public function getPassword(): ?string
  109.     {
  110.         return $this->password;
  111.     }
  112.     public function setPassword(?string $password): void
  113.     {
  114.         $this->password $password;
  115.     }
  116.     public function getFirstName(): ?string
  117.     {
  118.         return $this->firstName;
  119.     }
  120.     public function setFirstName(?string $firstName): void
  121.     {
  122.         $this->firstName $firstName;
  123.     }
  124.     public function getLastName(): ?string
  125.     {
  126.         return $this->lastName;
  127.     }
  128.     public function setLastName(?string $lastName): void
  129.     {
  130.         $this->lastName $lastName;
  131.     }
  132.     public function getMiddleName(): ?string
  133.     {
  134.         return $this->middleName;
  135.     }
  136.     public function setMiddleName(?string $middleName): void
  137.     {
  138.         $this->middleName $middleName;
  139.     }
  140.     public function getReserves(): Collection
  141.     {
  142.         return $this->reserves;
  143.     }
  144.     public function setReserves(Collection $reserves): void
  145.     {
  146.         $this->reserves $reserves;
  147.     }
  148.     public function __toString(): string
  149.     {
  150.         return sprintf(
  151.             '(%s) %s %s %s',
  152.             $this->getUserNumber(),
  153.             $this->getFirstName(),
  154.             $this->getLastName(),
  155.             $this->getMiddleName(),
  156.         );
  157.     }
  158.     public function getFio(): string
  159.     {
  160.         return sprintf('%s %s %s'$this->getFirstName(), $this->getLastName(), $this->getMiddleName());
  161.     }
  162.     public function getPassportIssueDate(): ?DateTime
  163.     {
  164.         return $this->passportIssueDate;
  165.     }
  166.     public function setPassportIssueDate(?DateTime $passportIssueDate): void
  167.     {
  168.         $this->passportIssueDate $passportIssueDate;
  169.     }
  170.     public function getDriversLicenseDate(): ?DateTime
  171.     {
  172.         return $this->driversLicenseDate;
  173.     }
  174.     public function setDriversLicenseDate(?DateTime $driversLicenseDate): void
  175.     {
  176.         $this->driversLicenseDate $driversLicenseDate;
  177.     }
  178.     public function getPassportNumber(): ?string
  179.     {
  180.         return $this->passportNumber;
  181.     }
  182.     public function setPassportNumber(?string $passportNumber): void
  183.     {
  184.         $this->passportNumber $passportNumber;
  185.     }
  186.     public function getPassportId(): ?string
  187.     {
  188.         return $this->passportId;
  189.     }
  190.     public function setPassportId(?string $passportId): void
  191.     {
  192.         $this->passportId $passportId;
  193.     }
  194.     public function getDateSigningContract(): ?DateTime
  195.     {
  196.         return $this->dateSigningContract;
  197.     }
  198.     public function setDateSigningContract(?DateTime $dateSigningContract): void
  199.     {
  200.         $this->dateSigningContract $dateSigningContract;
  201.     }
  202.     public function getPassportIssuingAuthority(): ?string
  203.     {
  204.         return $this->passportIssuingAuthority;
  205.     }
  206.     public function setPassportIssuingAuthority(?string $passportIssuingAuthority): void
  207.     {
  208.         $this->passportIssuingAuthority $passportIssuingAuthority;
  209.     }
  210.     public function getRegistrationAddress(): ?string
  211.     {
  212.         return $this->registrationAddress;
  213.     }
  214.     public function setRegistrationAddress(?string $registrationAddress): void
  215.     {
  216.         $this->registrationAddress $registrationAddress;
  217.     }
  218.     public function getDriversLicenseNumber(): ?string
  219.     {
  220.         return $this->driversLicenseNumber;
  221.     }
  222.     public function setDriversLicenseNumber(?string $driversLicenseNumber): void
  223.     {
  224.         $this->driversLicenseNumber $driversLicenseNumber;
  225.     }
  226.     public function getDateOfBirth(): ?DateTime
  227.     {
  228.         return $this->dateOfBirth;
  229.     }
  230.     public function setDateOfBirth(?DateTime $dateOfBirth): void
  231.     {
  232.         $this->dateOfBirth $dateOfBirth;
  233.     }
  234.     public function getId(): int
  235.     {
  236.         return $this->id;
  237.     }
  238.     public function getNotes(): ?string
  239.     {
  240.         return $this->notes;
  241.     }
  242.     public function setNotes(?string $notes): self
  243.     {
  244.         $this->notes $notes;
  245.         return $this;
  246.     }
  247. }