src/Entity/Customer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CustomerRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCustomerRepository::class)]
  8. class Customer
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $uuid null;
  16.     #[ORM\OneToOne(targetEntityPerson::class, cascade: ['persist''remove'])]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?Person $person null;
  19.     #[ORM\OneToOne(targetEntityAddress::class, cascade: ['persist''remove'])]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?Address $address null;
  22.     #[ORM\OneToOne(
  23.         mappedBy'customer',
  24.         targetEntityUser::class,
  25.         cascade: ['persist''remove']
  26.     )]
  27.     #[ORM\JoinColumn(nullabletrue)]
  28.     private ?User $user null;
  29.     #[ORM\OneToOne(targetEntityContact::class, cascade: ['persist''remove'])]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     private ?Contact $contact null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $name null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $subtitle null;
  36.     #[ORM\Column]
  37.     private ?\DateTimeImmutable $createdAt null;
  38.     #[ORM\OneToOne(targetEntityCustomerConfiguration::class, cascade: ['persist''remove'], fetch'EAGER')]
  39.     #[ORM\JoinColumn(nullablefalse)]
  40.     private ?CustomerConfiguration $configuration null;
  41.     #[ORM\ManyToOne(targetEntityPartner::class)]
  42.     #[ORM\JoinColumn(referencedColumnName'id'nullabletrue)]
  43.     private ?Partner $partner null;
  44.     #[ORM\OneToMany(mappedBy'customer'targetEntityCustomerPackage::class, cascade: ['persist''remove'])]
  45.     private Collection $packages;
  46.     #[ORM\OneToOne(targetEntityImage::class, cascade: ['persist''remove'])]
  47.     #[ORM\JoinColumn(nullabletrue)]
  48.     private ?Image $logo null;
  49.     #[ORM\OneToOne(inversedBy'customer'targetEntityCustomerTaxInformation::class, cascade: ['persist''remove'])]
  50.     #[ORM\JoinColumn(nullablefalse)]
  51.     private ?CustomerTaxInformation $taxInformation null;
  52.     #[ORM\OneToOne(targetEntityCustomerInvoiceSettings::class, cascade: ['persist''remove'], fetch"EAGER")]
  53.     #[ORM\JoinColumn(nullablefalse)]
  54.     private ?CustomerInvoiceSettings $invoiceSettings null;
  55.     #[ORM\OneToOne(targetEntityCustomerContractSettings::class, cascade: ['persist''remove'])]
  56.     #[ORM\JoinColumn(nullablefalse)]
  57.     private ?CustomerContractSettings $contractSettings null;
  58.     #[ORM\OneToMany(mappedBy'customer'targetEntityCustomerBankAccount::class, cascade: ['persist''remove'])]
  59.     private Collection $bankAccounts;
  60.     #[ORM\OneToMany(mappedBy'customer'targetEntitySponsor::class, cascade: ['persist''remove'])]
  61.     private Collection $sponsor;
  62.     #[ORM\OneToOne(targetEntityCustomerContentHowTo::class, cascade: ['persist''remove'], fetch'EAGER')]
  63.     #[ORM\JoinColumn(nullablefalse)]
  64.     private ?CustomerContentHowTo $contentHowTo null;
  65.     #[ORM\OneToOne(targetEntityCustomerContentAboutUs::class, cascade: ['persist''remove'], fetch'EAGER')]
  66.     #[ORM\JoinColumn(nullablefalse)]
  67.     private ?CustomerContentAboutUs $contentAboutUs null;
  68.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  69.     #[ORM\JoinColumn(nullablefalse)]
  70.     private ?CustomerTemplate $template null;
  71.     #[ORM\OneToOne(cascade: ['persist''remove'], fetch'EAGER')]
  72.     #[ORM\JoinColumn(nullablefalse)]
  73.     private ?CustomerFaq $faq null;
  74.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  75.     #[ORM\JoinColumn(nullabletrue)]
  76.     private ?CustomerNotification $notification null;
  77.     public function __construct()
  78.     {
  79.         $this->packages = new ArrayCollection();
  80.         $this->bankAccounts = new ArrayCollection();
  81.         $this->sponsor = new ArrayCollection();
  82.     }
  83.     public function getId(): ?int
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getName(): ?string
  88.     {
  89.         return $this->name;
  90.     }
  91.     public function setName(string $name): self
  92.     {
  93.         $this->name $name;
  94.         return $this;
  95.     }
  96.     public function getSubtitle(): ?string
  97.     {
  98.         return $this->subtitle;
  99.     }
  100.     public function setSubtitle(?string $subtitle): self
  101.     {
  102.         $this->subtitle $subtitle;
  103.         return $this;
  104.     }
  105.     public function getCreatedAt(): ?\DateTimeImmutable
  106.     {
  107.         return $this->createdAt;
  108.     }
  109.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  110.     {
  111.         $this->createdAt $createdAt;
  112.         return $this;
  113.     }
  114.     public function getPerson(): ?Person
  115.     {
  116.         return $this->person;
  117.     }
  118.     public function setPerson(Person $person): self
  119.     {
  120.         $this->person $person;
  121.         return $this;
  122.     }
  123.     public function getAddress(): ?Address
  124.     {
  125.         return $this->address;
  126.     }
  127.     public function setAddress(Address $address): self
  128.     {
  129.         $this->address $address;
  130.         return $this;
  131.     }
  132.     public function getUser(): ?User
  133.     {
  134.         return $this->user;
  135.     }
  136.     public function setUser(?User $user): self
  137.     {
  138.         $this->user $user;
  139.         return $this;
  140.     }
  141.     public function getContact(): ?Contact
  142.     {
  143.         return $this->contact;
  144.     }
  145.     public function setContact(Contact $contact): self
  146.     {
  147.         $this->contact $contact;
  148.         return $this;
  149.     }
  150.     public function getConfiguration(): ?CustomerConfiguration
  151.     {
  152.         return $this->configuration;
  153.     }
  154.     public function setConfiguration(CustomerConfiguration $configuration): self
  155.     {
  156.         $this->configuration $configuration;
  157.         return $this;
  158.     }
  159.     public function getPartner(): ?Partner
  160.     {
  161.         return $this->partner;
  162.     }
  163.     public function setPartner(?Partner $partner): self
  164.     {
  165.         $this->partner $partner;
  166.         return $this;
  167.     }
  168.     /**
  169.      * @return Collection<int, CustomerPackage>
  170.      */
  171.     public function getPackages(): Collection
  172.     {
  173.         return $this->packages;
  174.     }
  175.     public function addPackage(CustomerPackage $package): self
  176.     {
  177.         if (!$this->packages->contains($package)) {
  178.             $this->packages->add($package);
  179.             $package->setCustomer($this);
  180.         }
  181.         return $this;
  182.     }
  183.     public function removePackage(CustomerPackage $package): self
  184.     {
  185.         if ($this->packages->removeElement($package)) {
  186.             // set the owning side to null (unless already changed)
  187.             if ($package->getCustomer() === $this) {
  188.                 $package->setCustomer(null);
  189.             }
  190.         }
  191.         return $this;
  192.     }
  193.     public function getLogo(): ?Image
  194.     {
  195.         return $this->logo;
  196.     }
  197.     public function setLogo(?Image $logo): self
  198.     {
  199.         $this->logo $logo;
  200.         return $this;
  201.     }
  202.     public function getTaxInformation(): ?CustomerTaxInformation
  203.     {
  204.         return $this->taxInformation;
  205.     }
  206.     public function setTaxInformation(CustomerTaxInformation $taxInformation): self
  207.     {
  208.         $this->taxInformation $taxInformation;
  209.         return $this;
  210.     }
  211.     public function getInvoiceSettings(): ?CustomerInvoiceSettings
  212.     {
  213.         return $this->invoiceSettings;
  214.     }
  215.     public function setInvoiceSettings(CustomerInvoiceSettings $invoiceSettings): self
  216.     {
  217.         $this->invoiceSettings $invoiceSettings;
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return Collection<int, CustomerBankAccount>
  222.      */
  223.     public function getBankAccounts(): Collection
  224.     {
  225.         return $this->bankAccounts;
  226.     }
  227.     public function addBankAccount(CustomerBankAccount $bankAccount): self
  228.     {
  229.         if (!$this->bankAccounts->contains($bankAccount)) {
  230.             $this->bankAccounts->add($bankAccount);
  231.             $bankAccount->setCustomer($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeBankAccount(CustomerBankAccount $bankAccount): self
  236.     {
  237.         if ($this->bankAccounts->removeElement($bankAccount)) {
  238.             // set the owning side to null (unless already changed)
  239.             if ($bankAccount->getCustomer() === $this) {
  240.                 $bankAccount->setCustomer(null);
  241.             }
  242.         }
  243.         return $this;
  244.     }
  245.     /**
  246.      * @return Collection<int, Sponsor>
  247.      */
  248.     public function getSponsor(): Collection
  249.     {
  250.         return $this->sponsor;
  251.     }
  252.     public function addSponsor(Sponsor $sponsor): self
  253.     {
  254.         if (!$this->sponsor->contains($sponsor)) {
  255.             $this->sponsor->add($sponsor);
  256.             $sponsor->setCustomer($this);
  257.         }
  258.         return $this;
  259.     }
  260.     public function removeSponsor(Sponsor $sponsor): self
  261.     {
  262.         if ($this->sponsor->removeElement($sponsor)) {
  263.             // set the owning side to null (unless already changed)
  264.             if ($sponsor->getCustomer() === $this) {
  265.                 $sponsor->setCustomer(null);
  266.             }
  267.         }
  268.         return $this;
  269.     }
  270.     public function getContentHowTo(): ?CustomerContentHowTo
  271.     {
  272.         return $this->contentHowTo;
  273.     }
  274.     public function setContentHowTo(CustomerContentHowTo $contentHowTo): self
  275.     {
  276.         $this->contentHowTo $contentHowTo;
  277.         return $this;
  278.     }
  279.     public function getContentAboutUs(): ?CustomerContentAboutUs
  280.     {
  281.         return $this->contentAboutUs;
  282.     }
  283.     public function setContentAboutUs(CustomerContentAboutUs $contentAboutUs): self
  284.     {
  285.         $this->contentAboutUs $contentAboutUs;
  286.         return $this;
  287.     }
  288.     public function getTemplate(): ?CustomerTemplate
  289.     {
  290.         return $this->template;
  291.     }
  292.     public function setTemplate(CustomerTemplate $template): self
  293.     {
  294.         $this->template $template;
  295.         return $this;
  296.     }
  297.     public function getFaq(): ?CustomerFaq
  298.     {
  299.         return $this->faq;
  300.     }
  301.     public function setFaq(CustomerFaq $faq): self
  302.     {
  303.         $this->faq $faq;
  304.         return $this;
  305.     }
  306.     public function getContractSettings(): ?CustomerContractSettings
  307.     {
  308.         return $this->contractSettings;
  309.     }
  310.     public function setContractSettings(CustomerContractSettings $contractSettings): self
  311.     {
  312.         $this->contractSettings $contractSettings;
  313.         return $this;
  314.     }
  315.     public function getNotification(): ?CustomerNotification
  316.     {
  317.         return $this->notification;
  318.     }
  319.     public function setNotification(?CustomerNotification $notification): self
  320.     {
  321.         $this->notification $notification;
  322.         return $this;
  323.     }
  324.     public function getUuid(): ?string
  325.     {
  326.         return $this->uuid;
  327.     }
  328.     public function setUuid(string $uuid): self
  329.     {
  330.         $this->uuid $uuid;
  331.         return $this;
  332.     }
  333. }