src/Entity/CRM/CustomerAddress.php line 16
<?phpnamespace App\Entity\CRM;use App\Entity\CRM\Order;use App\Entity\CRM\OrderCustomerAddress;use App\Repository\CustomerAddressRepository;use DateTime;use DateTimeInterface;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CustomerAddressRepository::class)]class CustomerAddress{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $firstName = null;#[ORM\Column(length: 255)]private ?string $lastName = 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 $companyNumber = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private DateTimeInterface $addedDate;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?DateTimeInterface $updateDate = null;#[ORM\Column]private ?bool $checkUser = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $userNote = null;#[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'customerAddresses')]#[ORM\JoinColumn(nullable: false)]private ?Customer $customer = null;#[ORM\OneToMany(mappedBy: 'customerAddress', targetEntity: Order::class)]#[ORM\JoinColumn(nullable: true)]private Collection $orders;#[ORM\Column(length: 255, nullable: true)]private ?string $email = null;#[ORM\Column]private ?bool $isActive = null;#[ORM\Column(length: 22, nullable: true)]private ?string $phone = null;#[ORM\OneToMany(mappedBy: 'customerAddress', targetEntity: OrderCustomerAddress::class)]private Collection $orderCustomerAddresses;#[ORM\OneToMany(mappedBy: 'customerAddress', targetEntity: CommercialOfferIndividual::class)]private Collection $commercialOfferIndividuals;#[ORM\Column(nullable: true)]private ?string $regon = null;public function __construct(){$this->addedDate = new DateTime();$this->orders = new ArrayCollection();$this->orderCustomerAddresses = new ArrayCollection();$this->commercialOfferIndividuals = new ArrayCollection();}public function __toString(){return $this->getName();}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 getFirstName(): ?string{return $this->firstName;}public function setFirstName(string $firstName): self{$this->firstName = $firstName;return $this;}public function getLastName(): ?string{return $this->lastName;}public function setLastName(string $lastName): self{$this->lastName = $lastName;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 getCompanyNumber(): ?string{return $this->companyNumber;}public function setCompanyNumber(string $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 getUpdateDate(): ?DateTimeInterface{return $this->updateDate;}public function setUpdateDate(DateTimeInterface $updateDate): self{$this->updateDate = $updateDate;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 getCustomer(): ?Customer{return $this->customer;}public function setCustomer(?Customer $customer): self{$this->customer = $customer;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(?string $email): self{$this->email = $email;return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): self{$this->isActive = $isActive;return $this;}public function getOrder(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);}return $this;}public function removeOrder(Order $order): self{$this->orders->removeElement($order);return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(?string $phone): static{$this->phone = $phone;return $this;}/*** @return Collection<int, OrderCustomerAddress>*/public function getOrderCustomerAddresses(): Collection{return $this->orderCustomerAddresses;}public function addOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static{if (!$this->orderCustomerAddresses->contains($orderCustomerAddress)) {$this->orderCustomerAddresses->add($orderCustomerAddress);$orderCustomerAddress->setCustomerAddress($this);}return $this;}public function removeOrderCustomerAddress(OrderCustomerAddress $orderCustomerAddress): static{if ($this->orderCustomerAddresses->removeElement($orderCustomerAddress)) {// set the owning side to null (unless already changed)if ($orderCustomerAddress->getCustomerAddress() === $this) {$orderCustomerAddress->setCustomerAddress(null);}}return $this;}/*** @return Collection<int, CommercialOfferIndividual>*/public function getCommercialOfferIndividuals(): Collection{return $this->commercialOfferIndividuals;}public function addCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static{if (!$this->commercialOfferIndividuals->contains($commercialOfferIndividual)) {$this->commercialOfferIndividuals->add($commercialOfferIndividual);$commercialOfferIndividual->setCustomerAddress($this);}return $this;}public function removeCommercialOfferIndividual(CommercialOfferIndividual $commercialOfferIndividual): static{if ($this->commercialOfferIndividuals->removeElement($commercialOfferIndividual)) {// set the owning side to null (unless already changed)if ($commercialOfferIndividual->getCustomerAddress() === $this) {$commercialOfferIndividual->setCustomerAddress(null);}}return $this;}public function getRegon(): ?string{return $this->regon;}public function setRegon(?string $regon): static{$this->regon = $regon;return $this;}}