src/Entity/CRM/Customer.php line 15
<?phpnamespace App\Entity\CRM;use App\Entity\CRM\Order;use App\Entity\CRM\OrderCustomerAddress;use App\Repository\CustomerRepository;use DateTime;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CustomerRepository::class)]class Customer{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $lastName = null;#[ORM\Column(length: 255)]private ?string $firstName = null;#[ORM\Column(length: 255)]private ?string $address = null;#[ORM\Column(length: 255)]private ?string $city = null;#[ORM\Column(length: 255)]private ?string $zipCode = null;#[ORM\Column(length: 255)]private ?string $email = null;#[ORM\Column(length: 10)]private ?string $companyNumber = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private \DateTimeInterface $addedDate;#[ORM\Column]private ?bool $checkUser = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $userNote = null;#[ORM\Column]private ?bool $isActive = null;#[ORM\Column(nullable: true)]private ?int $old_id = null;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: CustomerAddress::class, cascade: ['persist'], orphanRemoval: true)]private Collection $customerAddresses;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: OrderCustomerAddress::class)]private Collection $orderCustomerAddresses;#[ORM\ManyToOne(inversedBy: 'customers')]private ?Consultant $consultant = null;#[ORM\Column(length: 255, nullable: true)]private ?string $phone = null;#[ORM\Column]private ?bool $ordersBlock = null;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: CustomerHistory::class)]private Collection $customerHistories;#[ORM\Column(nullable: true)]private ?string $regon = null;public function __construct(){$this->addedDate = new DateTime();$this->customerAddresses = new ArrayCollection();$this->orders = new ArrayCollection();$this->orderCustomerAddresses = new ArrayCollection();$this->customerHistories = new ArrayCollection();}public function __toString(){return $this->getFirstName().' '.$this->getLastName();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getLastName(): ?string{return $this->lastName;}public function setLastName(string $lastName): self{$this->lastName = $lastName;return $this;}public function getFirstName(): ?string{return $this->firstName;}public function setFirstName(string $firstName): self{$this->firstName = $firstName;return $this;}public function getAddress(): ?string{return $this->address;}public function setAddress(string $address): self{$this->address = $address;return $this;}public function getCity(): ?string{return $this->city;}public function setCity(string $city): self{$this->city = $city;return $this;}public function getZipCode(): ?string{return $this->zipCode;}public function setZipCode(string $zipCode): self{$this->zipCode = $zipCode;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}public function getCompanyNumber(): ?int{return $this->companyNumber;}public function setCompanyNumber(int $companyNumber): self{$this->companyNumber = $companyNumber;return $this;}public function getAddedDate(): ?\DateTimeInterface{return $this->addedDate;}public function setAddedDate(\DateTimeInterface $addedDate): self{$this->addedDate = $addedDate;return $this;}public function isCheckUser(): ?bool{return $this->checkUser;}public function setCheckUser(bool $checkUser): self{$this->checkUser = $checkUser;return $this;}public function getUserNote(): ?string{return $this->userNote;}public function setUserNote(?string $userNote): self{$this->userNote = $userNote;return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): self{$this->isActive = $isActive;return $this;}public function getOldId(): ?int{return $this->old_id;}public function setOldId(?int $old_id): self{$this->old_id = $old_id;return $this;}/*** @return Collection<int, CustomerAddress>*/public function getCustomerAddresses(): Collection{return $this->customerAddresses;}public function addCustomerAddress(CustomerAddress $customerAddress): self{if (!$this->customerAddresses->contains($customerAddress)) {$this->customerAddresses->add($customerAddress);$customerAddress->setCustomer($this);}return $this;}public function removeCustomerAddress(CustomerAddress $customerAddress): self{if ($this->customerAddresses->removeElement($customerAddress)) {// set the owning side to null (unless already changed)if ($customerAddress->getCustomer() === $this) {$customerAddress->setCustomer(null);}}return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setCustomer($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getCustomer() === $this) {$order->setCustomer(null);}}return $this;}/*** @return Collection<int, OrderCustomerAddress>*/public function getOrderCustomerAddresses(): Collection{return $this->orderCustomerAddresses;}public function addOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): self{if (!$this->orderCustomerAddresses->contains($orderCustomerAddress)) {$this->orderCustomerAddresses->add($orderCustomerAddress);$orderCustomerAddress->setCustomer($this);}return $this;}public function removeOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): self{if ($this->orderCustomerAddresses->removeElement($orderCustomerAddress)) {// set the owning side to null (unless already changed)if ($orderCustomerAddress->getCustomer() === $this) {$orderCustomerAddress->setCustomer(null);}}return $this;}public function getConsultant(): ?Consultant{return $this->consultant;}public function setConsultant(?Consultant $consultant): static{$this->consultant = $consultant;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): static{$this->phone = $phone;return $this;}public function isOrdersBlock(): ?bool{return $this->ordersBlock;}public function setOrdersBlock(bool $ordersBlock): static{$this->ordersBlock = $ordersBlock;return $this;}/*** @return Collection<int, CustomerHistory>*/public function getCustomerHistories(): Collection{return $this->customerHistories;}public function addCustomerHistory(CustomerHistory $customerHistory): static{if (!$this->customerHistories->contains($customerHistory)) {$this->customerHistories->add($customerHistory);$customerHistory->setCustomer($this);}return $this;}public function removeCustomerHistory(CustomerHistory $customerHistory): static{if ($this->customerHistories->removeElement($customerHistory)) {// set the owning side to null (unless already changed)if ($customerHistory->getCustomer() === $this) {$customerHistory->setCustomer(null);}}return $this;}public function getRegon(): ?string{return $this->regon;}public function setRegon(?string $regon): static{$this->regon = $regon;return $this;}}