src/Entity/CRM/CustomerAddress.php line 16

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Entity\CRM\OrderCustomerAddress;
  5. use App\Repository\CustomerAddressRepository;
  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. #[ORM\Entity(repositoryClassCustomerAddressRepository::class)]
  13. class CustomerAddress
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $name null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $firstName null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $lastName null;
  25.     #[ORM\Column(length255)]
  26.     private ?string $address null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $city null;
  29.     #[ORM\Column(length255)]
  30.     private ?string $zipCode null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $companyNumber null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  34.     private DateTimeInterface $addedDate;
  35.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  36.     private ?DateTimeInterface $updateDate null;
  37.     #[ORM\Column]
  38.     private ?bool $checkUser null;
  39.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  40.     private ?string $userNote null;
  41.     #[ORM\ManyToOne(cascade: ['persist'], inversedBy'customerAddresses')]
  42.     #[ORM\JoinColumn(nullablefalse)]
  43.     private ?Customer $customer null;
  44.     #[ORM\OneToMany(mappedBy'customerAddress'targetEntityOrder::class)]
  45.     #[ORM\JoinColumn(nullabletrue)]
  46.     private Collection $orders;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $email null;
  49.     #[ORM\Column]
  50.     private ?bool $isActive null;
  51.     #[ORM\Column(length22nullabletrue)]
  52.     private ?string $phone null;
  53.     #[ORM\OneToMany(mappedBy'customerAddress'targetEntityOrderCustomerAddress::class)]
  54.     private Collection $orderCustomerAddresses;
  55.     #[ORM\OneToMany(mappedBy'customerAddress'targetEntityCommercialOfferIndividual::class)]
  56.     private Collection $commercialOfferIndividuals;
  57.     #[ORM\Column(nullabletrue)]
  58.     private ?string $regon null;
  59.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  60.     private ?array $gusReport null;
  61.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  62.     private ?DateTimeInterface $gusReportUpdatedAt null;
  63.     public function __construct()
  64.     {
  65.         $this->addedDate = new DateTime();
  66.         $this->orders = new ArrayCollection();
  67.         $this->orderCustomerAddresses = new ArrayCollection();
  68.         $this->commercialOfferIndividuals = new ArrayCollection();
  69.     }
  70.     public function __toString()
  71.     {
  72.         return $this->getName();
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getName(): ?string
  79.     {
  80.         return $this->name;
  81.     }
  82.     public function setName(string $name): self
  83.     {
  84.         $this->name $name;
  85.         return $this;
  86.     }
  87.     public function getFirstName(): ?string
  88.     {
  89.         return $this->firstName;
  90.     }
  91.     public function setFirstName(string $firstName): self
  92.     {
  93.         $this->firstName $firstName;
  94.         return $this;
  95.     }
  96.     public function getLastName(): ?string
  97.     {
  98.         return $this->lastName;
  99.     }
  100.     public function setLastName(string $lastName): self
  101.     {
  102.         $this->lastName $lastName;
  103.         return $this;
  104.     }
  105.     public function getAddress(): ?string
  106.     {
  107.         return $this->address;
  108.     }
  109.     public function setAddress(string $address): self
  110.     {
  111.         $this->address $address;
  112.         return $this;
  113.     }
  114.     public function getCity(): ?string
  115.     {
  116.         return $this->city;
  117.     }
  118.     public function setCity(string $city): self
  119.     {
  120.         $this->city $city;
  121.         return $this;
  122.     }
  123.     public function getZipCode(): ?string
  124.     {
  125.         return $this->zipCode;
  126.     }
  127.     public function setZipCode(string $zipCode): self
  128.     {
  129.         $this->zipCode $zipCode;
  130.         return $this;
  131.     }
  132.     public function getCompanyNumber(): ?string
  133.     {
  134.         return $this->companyNumber;
  135.     }
  136.     public function setCompanyNumber(string $companyNumber): self
  137.     {
  138.         $this->companyNumber $companyNumber;
  139.         return $this;
  140.     }
  141.     public function getAddedDate(): ?DateTimeInterface
  142.     {
  143.         return $this->addedDate;
  144.     }
  145.     public function setAddedDate(DateTimeInterface $addedDate): self
  146.     {
  147.         $this->addedDate $addedDate;
  148.         return $this;
  149.     }
  150.     public function getUpdateDate(): ?DateTimeInterface
  151.     {
  152.         return $this->updateDate;
  153.     }
  154.     public function setUpdateDate(DateTimeInterface $updateDate): self
  155.     {
  156.         $this->updateDate $updateDate;
  157.         return $this;
  158.     }
  159.     public function isCheckUser(): ?bool
  160.     {
  161.         return $this->checkUser;
  162.     }
  163.     public function setCheckUser(bool $checkUser): self
  164.     {
  165.         $this->checkUser $checkUser;
  166.         return $this;
  167.     }
  168.     public function getUserNote(): ?string
  169.     {
  170.         return $this->userNote;
  171.     }
  172.     public function setUserNote(?string $userNote): self
  173.     {
  174.         $this->userNote $userNote;
  175.         return $this;
  176.     }
  177.     public function getCustomer(): ?Customer
  178.     {
  179.         return $this->customer;
  180.     }
  181.     public function setCustomer(?Customer $customer): self
  182.     {
  183.         $this->customer $customer;
  184.         return $this;
  185.     }
  186.     public function getEmail(): ?string
  187.     {
  188.         return $this->email;
  189.     }
  190.     public function setEmail(?string $email): self
  191.     {
  192.         $this->email $email;
  193.         return $this;
  194.     }
  195.     public function isIsActive(): ?bool
  196.     {
  197.         return $this->isActive;
  198.     }
  199.     public function setIsActive(bool $isActive): self
  200.     {
  201.         $this->isActive $isActive;
  202.         return $this;
  203.     }
  204.     public function getOrder(): Collection
  205.     {
  206.         return $this->orders;
  207.     }
  208.     public function addOrder(Order $order): self
  209.     {
  210.         if (!$this->orders->contains($order)) {
  211.             $this->orders->add($order);
  212.         }
  213.         return $this;
  214.     }
  215.     public function removeOrder(Order $order): self
  216.     {
  217.         $this->orders->removeElement($order);
  218.         return $this;
  219.     }
  220.     public function getPhone(): ?string
  221.     {
  222.         return $this->phone;
  223.     }
  224.     public function setPhone(?string $phone): static
  225.     {
  226.         $this->phone $phone;
  227.         return $this;
  228.     }
  229.     /**
  230.      * @return Collection<int, OrderCustomerAddress>
  231.      */
  232.     public function getOrderCustomerAddresses(): Collection
  233.     {
  234.         return $this->orderCustomerAddresses;
  235.     }
  236.     public function addOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static
  237.     {
  238.         if (!$this->orderCustomerAddresses->contains($orderCustomerAddress)) {
  239.             $this->orderCustomerAddresses->add($orderCustomerAddress);
  240.             $orderCustomerAddress->setCustomerAddress($this);
  241.         }
  242.         return $this;
  243.     }
  244.     public function removeOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static
  245.     {
  246.         if ($this->orderCustomerAddresses->removeElement($orderCustomerAddress)) {
  247.             // set the owning side to null (unless already changed)
  248.             if ($orderCustomerAddress->getCustomerAddress() === $this) {
  249.                 $orderCustomerAddress->setCustomerAddress(null);
  250.             }
  251.         }
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return Collection<int, CommercialOfferIndividual>
  256.      */
  257.     public function getCommercialOfferIndividuals(): Collection
  258.     {
  259.         return $this->commercialOfferIndividuals;
  260.     }
  261.     public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  262.     {
  263.         if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {
  264.             $this->commercialOfferIndividuals->add($commercialOfferIndividual);
  265.             $commercialOfferIndividual->setCustomerAddress($this);
  266.         }
  267.         return $this;
  268.     }
  269.     public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  270.     {
  271.         if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {
  272.             // set the owning side to null (unless already changed)
  273.             if ($commercialOfferIndividual->getCustomerAddress() === $this) {
  274.                 $commercialOfferIndividual->setCustomerAddress(null);
  275.             }
  276.         }
  277.         return $this;
  278.     }
  279.     public function getRegon(): ?string
  280.     {
  281.         return $this->regon;
  282.     }
  283.     public function setRegon(?string $regon): static
  284.     {
  285.         $this->regon $regon;
  286.         return $this;
  287.     }
  288.     public function getGusReport(): ?array
  289.     {
  290.         return $this->gusReport;
  291.     }
  292.     public function setGusReport(?array $gusReport): void
  293.     {
  294.         $this->gusReport $gusReport;
  295.     }
  296.     public function getGusReportUpdatedAt(): ?DateTimeInterface
  297.     {
  298.         return $this->gusReportUpdatedAt;
  299.     }
  300.     public function setGusReportUpdatedAt(?DateTimeInterface $gusReportUpdatedAt): void
  301.     {
  302.         $this->gusReportUpdatedAt $gusReportUpdatedAt;
  303.     }
  304. }