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.     public function __construct()
  60.     {
  61.         $this->addedDate = new DateTime();
  62.         $this->orders = new ArrayCollection();
  63.         $this->orderCustomerAddresses = new ArrayCollection();
  64.         $this->commercialOfferIndividuals = new ArrayCollection();
  65.     }
  66.     public function __toString()
  67.     {
  68.         return $this->getName();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): self
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getFirstName(): ?string
  84.     {
  85.         return $this->firstName;
  86.     }
  87.     public function setFirstName(string $firstName): self
  88.     {
  89.         $this->firstName $firstName;
  90.         return $this;
  91.     }
  92.     public function getLastName(): ?string
  93.     {
  94.         return $this->lastName;
  95.     }
  96.     public function setLastName(string $lastName): self
  97.     {
  98.         $this->lastName $lastName;
  99.         return $this;
  100.     }
  101.     public function getAddress(): ?string
  102.     {
  103.         return $this->address;
  104.     }
  105.     public function setAddress(string $address): self
  106.     {
  107.         $this->address $address;
  108.         return $this;
  109.     }
  110.     public function getCity(): ?string
  111.     {
  112.         return $this->city;
  113.     }
  114.     public function setCity(string $city): self
  115.     {
  116.         $this->city $city;
  117.         return $this;
  118.     }
  119.     public function getZipCode(): ?string
  120.     {
  121.         return $this->zipCode;
  122.     }
  123.     public function setZipCode(string $zipCode): self
  124.     {
  125.         $this->zipCode $zipCode;
  126.         return $this;
  127.     }
  128.     public function getCompanyNumber(): ?string
  129.     {
  130.         return $this->companyNumber;
  131.     }
  132.     public function setCompanyNumber(string $companyNumber): self
  133.     {
  134.         $this->companyNumber $companyNumber;
  135.         return $this;
  136.     }
  137.     public function getAddedDate(): ?DateTimeInterface
  138.     {
  139.         return $this->addedDate;
  140.     }
  141.     public function setAddedDate(DateTimeInterface $addedDate): self
  142.     {
  143.         $this->addedDate $addedDate;
  144.         return $this;
  145.     }
  146.     public function getUpdateDate(): ?DateTimeInterface
  147.     {
  148.         return $this->updateDate;
  149.     }
  150.     public function setUpdateDate(DateTimeInterface $updateDate): self
  151.     {
  152.         $this->updateDate $updateDate;
  153.         return $this;
  154.     }
  155.     public function isCheckUser(): ?bool
  156.     {
  157.         return $this->checkUser;
  158.     }
  159.     public function setCheckUser(bool $checkUser): self
  160.     {
  161.         $this->checkUser $checkUser;
  162.         return $this;
  163.     }
  164.     public function getUserNote(): ?string
  165.     {
  166.         return $this->userNote;
  167.     }
  168.     public function setUserNote(?string $userNote): self
  169.     {
  170.         $this->userNote $userNote;
  171.         return $this;
  172.     }
  173.     public function getCustomer(): ?Customer
  174.     {
  175.         return $this->customer;
  176.     }
  177.     public function setCustomer(?Customer $customer): self
  178.     {
  179.         $this->customer $customer;
  180.         return $this;
  181.     }
  182.     public function getEmail(): ?string
  183.     {
  184.         return $this->email;
  185.     }
  186.     public function setEmail(?string $email): self
  187.     {
  188.         $this->email $email;
  189.         return $this;
  190.     }
  191.     public function isIsActive(): ?bool
  192.     {
  193.         return $this->isActive;
  194.     }
  195.     public function setIsActive(bool $isActive): self
  196.     {
  197.         $this->isActive $isActive;
  198.         return $this;
  199.     }
  200.     public function getOrder(): Collection
  201.     {
  202.         return $this->orders;
  203.     }
  204.     public function addOrder(Order $order): self
  205.     {
  206.         if (!$this->orders->contains($order)) {
  207.             $this->orders->add($order);
  208.         }
  209.         return $this;
  210.     }
  211.     public function removeOrder(Order $order): self
  212.     {
  213.         $this->orders->removeElement($order);
  214.         return $this;
  215.     }
  216.     public function getPhone(): ?string
  217.     {
  218.         return $this->phone;
  219.     }
  220.     public function setPhone(?string $phone): static
  221.     {
  222.         $this->phone $phone;
  223.         return $this;
  224.     }
  225.     /**
  226.      * @return Collection<int, OrderCustomerAddress>
  227.      */
  228.     public function getOrderCustomerAddresses(): Collection
  229.     {
  230.         return $this->orderCustomerAddresses;
  231.     }
  232.     public function addOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static
  233.     {
  234.         if (!$this->orderCustomerAddresses->contains($orderCustomerAddress)) {
  235.             $this->orderCustomerAddresses->add($orderCustomerAddress);
  236.             $orderCustomerAddress->setCustomerAddress($this);
  237.         }
  238.         return $this;
  239.     }
  240.     public function removeOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static
  241.     {
  242.         if ($this->orderCustomerAddresses->removeElement($orderCustomerAddress)) {
  243.             // set the owning side to null (unless already changed)
  244.             if ($orderCustomerAddress->getCustomerAddress() === $this) {
  245.                 $orderCustomerAddress->setCustomerAddress(null);
  246.             }
  247.         }
  248.         return $this;
  249.     }
  250.     /**
  251.      * @return Collection<int, CommercialOfferIndividual>
  252.      */
  253.     public function getCommercialOfferIndividuals(): Collection
  254.     {
  255.         return $this->commercialOfferIndividuals;
  256.     }
  257.     public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  258.     {
  259.         if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {
  260.             $this->commercialOfferIndividuals->add($commercialOfferIndividual);
  261.             $commercialOfferIndividual->setCustomerAddress($this);
  262.         }
  263.         return $this;
  264.     }
  265.     public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static
  266.     {
  267.         if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {
  268.             // set the owning side to null (unless already changed)
  269.             if ($commercialOfferIndividual->getCustomerAddress() === $this) {
  270.                 $commercialOfferIndividual->setCustomerAddress(null);
  271.             }
  272.         }
  273.         return $this;
  274.     }
  275.     public function getRegon(): ?string
  276.     {
  277.         return $this->regon;
  278.     }
  279.     public function setRegon(?string $regon): static
  280.     {
  281.         $this->regon $regon;
  282.         return $this;
  283.     }
  284. }