<?php
namespace App\Entity;
use App\Repository\CustomerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
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 $uuid = null;
#[ORM\OneToOne(targetEntity: Person::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?Person $person = null;
#[ORM\OneToOne(targetEntity: Address::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?Address $address = null;
#[ORM\OneToOne(
mappedBy: 'customer',
targetEntity: User::class,
cascade: ['persist', 'remove']
)]
#[ORM\JoinColumn(nullable: true)]
private ?User $user = null;
#[ORM\OneToOne(targetEntity: Contact::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?Contact $contact = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $subtitle = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\OneToOne(targetEntity: CustomerConfiguration::class, cascade: ['persist', 'remove'], fetch: 'EAGER')]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerConfiguration $configuration = null;
#[ORM\ManyToOne(targetEntity: Partner::class)]
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: true)]
private ?Partner $partner = null;
#[ORM\OneToMany(mappedBy: 'customer', targetEntity: CustomerPackage::class, cascade: ['persist', 'remove'])]
private Collection $packages;
#[ORM\OneToOne(targetEntity: Image::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: true)]
private ?Image $logo = null;
#[ORM\OneToOne(inversedBy: 'customer', targetEntity: CustomerTaxInformation::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerTaxInformation $taxInformation = null;
#[ORM\OneToOne(targetEntity: CustomerInvoiceSettings::class, cascade: ['persist', 'remove'], fetch: "EAGER")]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerInvoiceSettings $invoiceSettings = null;
#[ORM\OneToOne(targetEntity: CustomerContractSettings::class, cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerContractSettings $contractSettings = null;
#[ORM\OneToMany(mappedBy: 'customer', targetEntity: CustomerBankAccount::class, cascade: ['persist', 'remove'])]
private Collection $bankAccounts;
#[ORM\OneToMany(mappedBy: 'customer', targetEntity: Sponsor::class, cascade: ['persist', 'remove'])]
private Collection $sponsor;
#[ORM\OneToOne(targetEntity: CustomerContentHowTo::class, cascade: ['persist', 'remove'], fetch: 'EAGER')]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerContentHowTo $contentHowTo = null;
#[ORM\OneToOne(targetEntity: CustomerContentAboutUs::class, cascade: ['persist', 'remove'], fetch: 'EAGER')]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerContentAboutUs $contentAboutUs = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerTemplate $template = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'], fetch: 'EAGER')]
#[ORM\JoinColumn(nullable: false)]
private ?CustomerFaq $faq = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: true)]
private ?CustomerNotification $notification = null;
public function __construct()
{
$this->packages = new ArrayCollection();
$this->bankAccounts = new ArrayCollection();
$this->sponsor = new ArrayCollection();
}
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 getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getPerson(): ?Person
{
return $this->person;
}
public function setPerson(Person $person): self
{
$this->person = $person;
return $this;
}
public function getAddress(): ?Address
{
return $this->address;
}
public function setAddress(Address $address): self
{
$this->address = $address;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(Contact $contact): self
{
$this->contact = $contact;
return $this;
}
public function getConfiguration(): ?CustomerConfiguration
{
return $this->configuration;
}
public function setConfiguration(CustomerConfiguration $configuration): self
{
$this->configuration = $configuration;
return $this;
}
public function getPartner(): ?Partner
{
return $this->partner;
}
public function setPartner(?Partner $partner): self
{
$this->partner = $partner;
return $this;
}
/**
* @return Collection<int, CustomerPackage>
*/
public function getPackages(): Collection
{
return $this->packages;
}
public function addPackage(CustomerPackage $package): self
{
if (!$this->packages->contains($package)) {
$this->packages->add($package);
$package->setCustomer($this);
}
return $this;
}
public function removePackage(CustomerPackage $package): self
{
if ($this->packages->removeElement($package)) {
// set the owning side to null (unless already changed)
if ($package->getCustomer() === $this) {
$package->setCustomer(null);
}
}
return $this;
}
public function getLogo(): ?Image
{
return $this->logo;
}
public function setLogo(?Image $logo): self
{
$this->logo = $logo;
return $this;
}
public function getTaxInformation(): ?CustomerTaxInformation
{
return $this->taxInformation;
}
public function setTaxInformation(CustomerTaxInformation $taxInformation): self
{
$this->taxInformation = $taxInformation;
return $this;
}
public function getInvoiceSettings(): ?CustomerInvoiceSettings
{
return $this->invoiceSettings;
}
public function setInvoiceSettings(CustomerInvoiceSettings $invoiceSettings): self
{
$this->invoiceSettings = $invoiceSettings;
return $this;
}
/**
* @return Collection<int, CustomerBankAccount>
*/
public function getBankAccounts(): Collection
{
return $this->bankAccounts;
}
public function addBankAccount(CustomerBankAccount $bankAccount): self
{
if (!$this->bankAccounts->contains($bankAccount)) {
$this->bankAccounts->add($bankAccount);
$bankAccount->setCustomer($this);
}
return $this;
}
public function removeBankAccount(CustomerBankAccount $bankAccount): self
{
if ($this->bankAccounts->removeElement($bankAccount)) {
// set the owning side to null (unless already changed)
if ($bankAccount->getCustomer() === $this) {
$bankAccount->setCustomer(null);
}
}
return $this;
}
/**
* @return Collection<int, Sponsor>
*/
public function getSponsor(): Collection
{
return $this->sponsor;
}
public function addSponsor(Sponsor $sponsor): self
{
if (!$this->sponsor->contains($sponsor)) {
$this->sponsor->add($sponsor);
$sponsor->setCustomer($this);
}
return $this;
}
public function removeSponsor(Sponsor $sponsor): self
{
if ($this->sponsor->removeElement($sponsor)) {
// set the owning side to null (unless already changed)
if ($sponsor->getCustomer() === $this) {
$sponsor->setCustomer(null);
}
}
return $this;
}
public function getContentHowTo(): ?CustomerContentHowTo
{
return $this->contentHowTo;
}
public function setContentHowTo(CustomerContentHowTo $contentHowTo): self
{
$this->contentHowTo = $contentHowTo;
return $this;
}
public function getContentAboutUs(): ?CustomerContentAboutUs
{
return $this->contentAboutUs;
}
public function setContentAboutUs(CustomerContentAboutUs $contentAboutUs): self
{
$this->contentAboutUs = $contentAboutUs;
return $this;
}
public function getTemplate(): ?CustomerTemplate
{
return $this->template;
}
public function setTemplate(CustomerTemplate $template): self
{
$this->template = $template;
return $this;
}
public function getFaq(): ?CustomerFaq
{
return $this->faq;
}
public function setFaq(CustomerFaq $faq): self
{
$this->faq = $faq;
return $this;
}
public function getContractSettings(): ?CustomerContractSettings
{
return $this->contractSettings;
}
public function setContractSettings(CustomerContractSettings $contractSettings): self
{
$this->contractSettings = $contractSettings;
return $this;
}
public function getNotification(): ?CustomerNotification
{
return $this->notification;
}
public function setNotification(?CustomerNotification $notification): self
{
$this->notification = $notification;
return $this;
}
public function getUuid(): ?string
{
return $this->uuid;
}
public function setUuid(string $uuid): self
{
$this->uuid = $uuid;
return $this;
}
}