src/Entity/CRM/BhpInspector.php line 17

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\OrderNote;
  4. use App\Entity\CRM\State;
  5. use App\Repository\BhpInspectorRepository;
  6. use DateTime;
  7. use DateTimeInterface;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\DBAL\Types\Types;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  13. #[ORM\Entity(repositoryClassBhpInspectorRepository::class)]
  14. class BhpInspector implements PasswordAuthenticatedUserInterface
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $login null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $password null;
  24.     #[ORM\Column(length255)]
  25.     private ?string $firstName null;
  26.     #[ORM\Column(length255)]
  27.     private ?string $lastName null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $email null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $name null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $zipCode null;
  34.     #[ORM\Column(length255)]
  35.     private ?string $city null;
  36.     #[ORM\Column(length255)]
  37.     private ?string $street null;
  38.     #[ORM\Column(length255)]
  39.     private ?string $nip null;
  40.     #[ORM\Column(length255)]
  41.     private ?string $phone null;
  42.     #[ORM\Column]
  43.     private ?bool $isActive null;
  44.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  45.     private ?DateTimeInterface $dateAdded;
  46.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  47.     private ?DateTimeInterface $contractBeginning null;
  48.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  49.     private ?DateTimeInterface $contractEnd null;
  50.     #[ORM\ManyToOne(inversedBy'bhpInspectors')]
  51.     #[ORM\JoinColumn(nullablefalse)]
  52.     private ?State $state null;
  53.     #[ORM\OneToMany(mappedBy'bhpInspector'targetEntityBhpOrderProduct::class)]
  54.     private Collection $bhpOrderProducts;
  55.     #[ORM\OneToMany(mappedBy'bhpInspector'targetEntityBhpOrderProductSettlements::class)]
  56.     private Collection $bhpOrderProductSettlements;
  57.     #[ORM\OneToMany(mappedBy'bhpInspector'targetEntityOrderNote::class)]
  58.     private Collection $orderNotes;
  59.     public function __construct()
  60.     {
  61.         $this->dateAdded = new DateTime();
  62.         $this->bhpOrderProducts = new ArrayCollection();
  63.         $this->bhpOrderProductSettlements = new ArrayCollection();
  64.         $this->orderNotes = new ArrayCollection();
  65.     }
  66.     public function __toString(): string
  67.     {
  68.         return $this->getFirstName() . ' ' $this->getLastName() . ', ' $this->getName();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getLogin(): ?string
  75.     {
  76.         return $this->login;
  77.     }
  78.     public function setLogin(string $login): static
  79.     {
  80.         $this->login $login;
  81.         return $this;
  82.     }
  83.     public function getPassword(): ?string
  84.     {
  85.         return $this->password;
  86.     }
  87.     public function setPassword(string $password): static
  88.     {
  89.         $this->password $password;
  90.         return $this;
  91.     }
  92.     public function getFirstName(): ?string
  93.     {
  94.         return $this->firstName;
  95.     }
  96.     public function setFirstName(string $firstName): static
  97.     {
  98.         $this->firstName $firstName;
  99.         return $this;
  100.     }
  101.     public function getLastName(): ?string
  102.     {
  103.         return $this->lastName;
  104.     }
  105.     public function setLastName(string $lastName): static
  106.     {
  107.         $this->lastName $lastName;
  108.         return $this;
  109.     }
  110.     public function getEmail(): ?string
  111.     {
  112.         return $this->email;
  113.     }
  114.     public function setEmail(string $email): static
  115.     {
  116.         $this->email $email;
  117.         return $this;
  118.     }
  119.     public function getName(): ?string
  120.     {
  121.         return $this->name;
  122.     }
  123.     public function setName(string $name): static
  124.     {
  125.         $this->name $name;
  126.         return $this;
  127.     }
  128.     public function getZipCode(): ?string
  129.     {
  130.         return $this->zipCode;
  131.     }
  132.     public function setZipCode(string $zipCode): static
  133.     {
  134.         $this->zipCode $zipCode;
  135.         return $this;
  136.     }
  137.     public function getCity(): ?string
  138.     {
  139.         return $this->city;
  140.     }
  141.     public function setCity(string $city): static
  142.     {
  143.         $this->city $city;
  144.         return $this;
  145.     }
  146.     public function getStreet(): ?string
  147.     {
  148.         return $this->street;
  149.     }
  150.     public function setStreet(string $street): static
  151.     {
  152.         $this->street $street;
  153.         return $this;
  154.     }
  155.     public function getNip(): ?string
  156.     {
  157.         return $this->nip;
  158.     }
  159.     public function setNip(string $nip): static
  160.     {
  161.         $this->nip $nip;
  162.         return $this;
  163.     }
  164.     public function getPhone(): ?string
  165.     {
  166.         return $this->phone;
  167.     }
  168.     public function setPhone(string $phone): static
  169.     {
  170.         $this->phone $phone;
  171.         return $this;
  172.     }
  173.     public function isIsActive(): ?bool
  174.     {
  175.         return $this->isActive;
  176.     }
  177.     public function setIsActive(bool $isActive): static
  178.     {
  179.         $this->isActive $isActive;
  180.         return $this;
  181.     }
  182.     public function getDateAdded(): ?DateTimeInterface
  183.     {
  184.         return $this->dateAdded;
  185.     }
  186.     public function setDateAdded(DateTimeInterface $dateAdded): static
  187.     {
  188.         $this->dateAdded $dateAdded;
  189.         return $this;
  190.     }
  191.     public function getContractBeginning(): ?DateTimeInterface
  192.     {
  193.         return $this->contractBeginning;
  194.     }
  195.     public function setContractBeginning(DateTimeInterface $contractBeginning): static
  196.     {
  197.         $this->contractBeginning $contractBeginning;
  198.         return $this;
  199.     }
  200.     public function getContractEnd(): ?DateTimeInterface
  201.     {
  202.         return $this->contractEnd;
  203.     }
  204.     public function setContractEnd(?DateTimeInterface $contractEnd): static
  205.     {
  206.         $this->contractEnd $contractEnd;
  207.         return $this;
  208.     }
  209.     public function getState(): ?state
  210.     {
  211.         return $this->state;
  212.     }
  213.     public function setState(?state $state): static
  214.     {
  215.         $this->state $state;
  216.         return $this;
  217.     }
  218.     /**
  219.      * @return Collection<int, BhpOrderProduct>
  220.      */
  221.     public function getBhpOrderProducts(): Collection
  222.     {
  223.         return $this->bhpOrderProducts;
  224.     }
  225.     public function addBhpOrderProduct(BhpOrderProduct $bhpOrderProduct): static
  226.     {
  227.         if (!$this->bhpOrderProducts->contains($bhpOrderProduct)) {
  228.             $this->bhpOrderProducts->add($bhpOrderProduct);
  229.             $bhpOrderProduct->setBhpInspector($this);
  230.         }
  231.         return $this;
  232.     }
  233.     public function removeBhpOrderProduct(BhpOrderProduct $bhpOrderProduct): static
  234.     {
  235.         if ($this->bhpOrderProducts->removeElement($bhpOrderProduct)) {
  236.             // set the owning side to null (unless already changed)
  237.             if ($bhpOrderProduct->getBhpInspector() === $this) {
  238.                 $bhpOrderProduct->setBhpInspector(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     public function addBhpOrderProductSettlements(BhpOrderProductSettlements $bhpOrderProductSettlements): static
  244.     {
  245.         if (!$this->bhpOrderProductSettlements->contains($bhpOrderProductSettlements)) {
  246.             $this->bhpOrderProductSettlements->add($bhpOrderProductSettlements);
  247.             $bhpOrderProductSettlements->setBhpInspector($this);
  248.         }
  249.         return $this;
  250.     }
  251.     public function removeBhpOrderProductSettlements(BhpOrderProductSettlements $bhpOrderProductSettlements): static
  252.     {
  253.         if ($this->bhpOrderProductSettlements->removeElement($bhpOrderProductSettlements)) {
  254.             // set the owning side to null (unless already changed)
  255.             if ($bhpOrderProductSettlements->getBhpInspector() === $this) {
  256.                 $bhpOrderProductSettlements->setBhpInspector(null);
  257.             }
  258.         }
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, OrderNote>
  263.      */
  264.     public function getOrderNotes(): Collection
  265.     {
  266.         return $this->orderNotes;
  267.     }
  268.     public function addOrderNote(OrderNote $orderNote): static
  269.     {
  270.         if (!$this->orderNotes->contains($orderNote)) {
  271.             $this->orderNotes->add($orderNote);
  272.             $orderNote->setBhpInspector($this);
  273.         }
  274.         return $this;
  275.     }
  276.     public function removeOrderNote(OrderNote $orderNote): static
  277.     {
  278.         if ($this->orderNotes->removeElement($orderNote)) {
  279.             // set the owning side to null (unless already changed)
  280.             if ($orderNote->getBhpInspector() === $this) {
  281.                 $orderNote->setBhpInspector(null);
  282.             }
  283.         }
  284.         return $this;
  285.     }
  286. }