src/Entity/Client.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: ClientRepository::class)]
  9. class Client
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  16.     private ?\DateTimeInterface $CreatedAt = null;
  17.     #[ORM\ManyToOne(inversedBy: 'clients')]
  18.     private ?User $createdBy = null;
  19.     #[ORM\Column(length: 100, nullable: true)]
  20.     private ?string $FirstName = null;
  21.     #[ORM\Column(length: 100, nullable: true)]
  22.     private ?string $LastName = null;
  23.     #[ORM\Column(length: 2, nullable: true)]
  24.     private ?string $Gender = null;
  25.     #[ORM\ManyToOne(inversedBy: 'clients')]
  26.     private ?LawOffice $LawOffice = null;
  27.     #[ORM\Column(length: 10, nullable: true)]
  28.     private ?string $IdNumber = null;
  29.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  30.     private ?string $Adress = null;
  31.     #[ORM\Column(length: 20, nullable: true)]
  32.     private ?string $phone = null;
  33.     #[ORM\OneToMany(mappedBy: 'Client', targetEntity: TheCase::class)]
  34.     private Collection $theCases;
  35.     #[ORM\Column(nullable: true)]
  36.     private ?bool $IsDeleted = null;
  37.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  38.     private ?\DateTimeInterface $DeletedAt = null;
  39.     #[ORM\ManyToOne]
  40.     private ?User $DeletedBy = null;
  41.     #[ORM\Column(length: 20, nullable: true)]
  42.     private ?string $SecondaryPhone = null;
  43.     public function __construct()
  44.     {
  45.         $this->theCases = new ArrayCollection();
  46.     }
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getFirstName(): ?string
  52.     {
  53.         return $this->FirstName;
  54.     }
  55.     public function setFirstName(?string $FirstName): self
  56.     {
  57.         $this->FirstName = $FirstName;
  58.         return $this;
  59.     }
  60.     public function getLastName(): ?string
  61.     {
  62.         return $this->LastName;
  63.     }
  64.     public function setLastName(?string $LastName): self
  65.     {
  66.         $this->LastName = $LastName;
  67.         return $this;
  68.     }
  69.     public function getGender(): ?string
  70.     {
  71.         return $this->Gender;
  72.     }
  73.     public function setGender(?string $Gender): self
  74.     {
  75.         $this->Gender = $Gender;
  76.         return $this;
  77.     }
  78.     public function getCreatedAt(): ?\DateTimeInterface
  79.     {
  80.         return $this->CreatedAt;
  81.     }
  82.     public function setCreatedAt(?\DateTimeInterface $CreatedAt): self
  83.     {
  84.         $this->CreatedAt = $CreatedAt;
  85.         return $this;
  86.     }
  87.     public function getCreatedBy(): ?User
  88.     {
  89.         return $this->createdBy;
  90.     }
  91.     public function setCreatedBy(?User $createdBy): self
  92.     {
  93.         $this->createdBy = $createdBy;
  94.         return $this;
  95.     }
  96.     public function getLawOffice(): ?LawOffice
  97.     {
  98.         return $this->LawOffice;
  99.     }
  100.     public function setLawOffice(?LawOffice $LawOffice): self
  101.     {
  102.         $this->LawOffice = $LawOffice;
  103.         return $this;
  104.     }
  105.     public function getIdNumber(): ?string
  106.     {
  107.         return $this->IdNumber;
  108.     }
  109.     public function setIdNumber(?string $IdNumber): self
  110.     {
  111.         $this->IdNumber = $IdNumber;
  112.         return $this;
  113.     }
  114.     public function getAdress(): ?string
  115.     {
  116.         return $this->Adress;
  117.     }
  118.     public function setAdress(?string $Adress): self
  119.     {
  120.         $this->Adress = $Adress;
  121.         return $this;
  122.     }
  123.     public function getPhone(): ?string
  124.     {
  125.         return $this->phone;
  126.     }
  127.     public function setPhone(?string $phone): self
  128.     {
  129.         $this->phone = $phone;
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection<int, TheCase>
  134.      */
  135.     public function getTheCases(): Collection
  136.     {
  137.         return $this->theCases;
  138.     }
  139.     public function addTheCase(TheCase $theCase): self
  140.     {
  141.         if (!$this->theCases->contains($theCase)) {
  142.             $this->theCases->add($theCase);
  143.             $theCase->setClient($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeTheCase(TheCase $theCase): self
  148.     {
  149.         if ($this->theCases->removeElement($theCase)) {
  150.             // set the owning side to null (unless already changed)
  151.             if ($theCase->getClient() === $this) {
  152.                 $theCase->setClient(null);
  153.             }
  154.         }
  155.         return $this;
  156.     }
  157.     public function isIsDeleted(): ?bool
  158.     {
  159.         return $this->IsDeleted;
  160.     }
  161.     public function setIsDeleted(bool $IsDeleted): self
  162.     {
  163.         $this->IsDeleted = $IsDeleted;
  164.         return $this;
  165.     }
  166.     public function getDeletedAt(): ?\DateTimeInterface
  167.     {
  168.         return $this->DeletedAt;
  169.     }
  170.     public function setDeletedAt(\DateTimeInterface $DeletedAt): self
  171.     {
  172.         $this->DeletedAt = $DeletedAt;
  173.         return $this;
  174.     }
  175.     public function getDeletedBy(): ?User
  176.     {
  177.         return $this->DeletedBy;
  178.     }
  179.     public function setDeletedBy(?User $DeletedBy): self
  180.     {
  181.         $this->DeletedBy = $DeletedBy;
  182.         return $this;
  183.     }
  184.     public function getFullName(): string
  185.     {
  186.         return $this->getFirstName() . ' ' . $this->getLastName();
  187.     }
  188.     public function getSecondaryPhone(): ?string
  189.     {
  190.         return $this->SecondaryPhone;
  191.     }
  192.     public function setSecondaryPhone(?string $SecondaryPhone): self
  193.     {
  194.         $this->SecondaryPhone = $SecondaryPhone;
  195.         return $this;
  196.     }
  197. }