src/Entity/Company.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Base\AbstractTimestampableEntity;
  4. use App\Repository\CompanyRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=CompanyRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Company extends AbstractTimestampableEntity
  13. {
  14.     //fizikai szemely
  15.     const COMPANY_TYPE_PF 1;
  16.     //Jogi szemelyek(ceg)
  17.     const COMPANY_TYPE_PJ 2;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private string $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private string $codFiscal;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private ?string $nrRegCom="";
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private string $address;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private ?string $banca;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private ?string $contBancar;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private ?string $contactPerson;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private ?string $contactPersonTitle;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private ?string $tel;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private ?string $email;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity=Contract::class, mappedBy="company")
  60.      */
  61.     private Collection $contracts;
  62.     /**
  63.      * @ORM\Column(type="integer")
  64.      */
  65.     private int $type;
  66.     /**
  67.      * @ORM\OneToMany(targetEntity=FacturiHeader::class, mappedBy="company")
  68.      */
  69.     private Collection $facturiHeaders;
  70.     /**
  71.      * @ORM\Column(type="boolean",options={"default":false})
  72.      */
  73.     private bool $deleted false;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=Payment::class, mappedBy="company")
  76.      */
  77.     private Collection $payments;
  78.     /**
  79.      * @ORM\Column(type="boolean")
  80.      */
  81.     private $payerTva;
  82.     /**
  83.      * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="companies")
  84.      */
  85.     private $country;
  86.     /**
  87.      * @ORM\Column(type="boolean", options={"default":true})
  88.      */
  89.     private bool $billWithTva true;
  90.     /**
  91.      * @ORM\Column(type="boolean", options={"default":true})
  92.      */
  93.     private bool $zeroTva false;
  94.     /**
  95.      * @ORM\OneToMany(targetEntity=CashIn::class, mappedBy="company")
  96.      */
  97.     private $cashIns;
  98.     /**
  99.      * @ORM\OneToMany(targetEntity=CashOut::class, mappedBy="company")
  100.      */
  101.     private $cashOuts;
  102.     /**
  103.      * @ORM\ManyToOne(inversedBy="clients")
  104.      * @ORM\JoinColumn(nullable=true)
  105.      */
  106.     private ?County $county null;
  107.     /**
  108.      * @ORM\ManyToOne(inversedBy="clients")
  109.      * @ORM\JoinColumn(nullable=true)
  110.      */
  111.     private ?City $city null;
  112.     /**
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private ?string $anafStr;
  116.     /**
  117.      * @ORM\Column(type="string", length=255, nullable=true)
  118.      */
  119.     private ?string $anafNr;
  120.     /**
  121.      * @ORM\Column(type="string", length=255, nullable=true)
  122.      */
  123.     private ?string $anafLoc;
  124.     /**
  125.      * @ORM\Column(type="string", length=255, nullable=true)
  126.      */
  127.     private ?string $anafDenumireJud;
  128.     /**
  129.      * @ORM\Column(type="string", length=255, nullable=true)
  130.      */
  131.     private ?string $anafCodJud;
  132.     /**
  133.      * @ORM\Column(type="string", length=255, nullable=true)
  134.      */
  135.     private ?string $anafDetaliiAddresa;
  136.     /**
  137.      * @ORM\Column(type="string", length=255, nullable=true)
  138.      */
  139.     private ?string $anafCodPostal;
  140.     /**
  141.      * @return County|null
  142.      */
  143.     public function getCounty(): ?County
  144.     {
  145.         return $this->county;
  146.     }
  147.     /**
  148.      * @param County|null $county
  149.      */
  150.     public function setCounty(?County $county): void
  151.     {
  152.         $this->county $county;
  153.     }
  154.     /**
  155.      * @return City|null
  156.      */
  157.     public function getCity(): ?City
  158.     {
  159.         return $this->city;
  160.     }
  161.     /**
  162.      * @param City|null $city
  163.      */
  164.     public function setCity(?City $city): void
  165.     {
  166.         $this->city $city;
  167.     }
  168.     /**
  169.      * @return string|null
  170.      */
  171.     public function getAnafStr(): ?string
  172.     {
  173.         return $this->anafStr;
  174.     }
  175.     /**
  176.      * @param string|null $anafStr
  177.      */
  178.     public function setAnafStr(?string $anafStr): void
  179.     {
  180.         $this->anafStr $anafStr;
  181.     }
  182.     /**
  183.      * @return string|null
  184.      */
  185.     public function getAnafNr(): ?string
  186.     {
  187.         return $this->anafNr;
  188.     }
  189.     /**
  190.      * @param string|null $anafNr
  191.      */
  192.     public function setAnafNr(?string $anafNr): void
  193.     {
  194.         $this->anafNr $anafNr;
  195.     }
  196.     /**
  197.      * @return string|null
  198.      */
  199.     public function getAnafLoc(): ?string
  200.     {
  201.         return $this->anafLoc;
  202.     }
  203.     /**
  204.      * @param string|null $anafLoc
  205.      */
  206.     public function setAnafLoc(?string $anafLoc): void
  207.     {
  208.         $this->anafLoc $anafLoc;
  209.     }
  210.     /**
  211.      * @return string|null
  212.      */
  213.     public function getAnafDenumireJud(): ?string
  214.     {
  215.         return $this->anafDenumireJud;
  216.     }
  217.     /**
  218.      * @param string|null $anafDenumireJud
  219.      */
  220.     public function setAnafDenumireJud(?string $anafDenumireJud): void
  221.     {
  222.         $this->anafDenumireJud $anafDenumireJud;
  223.     }
  224.     /**
  225.      * @return string|null
  226.      */
  227.     public function getAnafCodJud(): ?string
  228.     {
  229.         return $this->anafCodJud;
  230.     }
  231.     /**
  232.      * @param string|null $anafCodJud
  233.      */
  234.     public function setAnafCodJud(?string $anafCodJud): void
  235.     {
  236.         $this->anafCodJud $anafCodJud;
  237.     }
  238.     /**
  239.      * @return string|null
  240.      */
  241.     public function getAnafDetaliiAddresa(): ?string
  242.     {
  243.         return $this->anafDetaliiAddresa;
  244.     }
  245.     /**
  246.      * @param string|null $anafDetaliiAddresa
  247.      */
  248.     public function setAnafDetaliiAddresa(?string $anafDetaliiAddresa): void
  249.     {
  250.         $this->anafDetaliiAddresa $anafDetaliiAddresa;
  251.     }
  252.     /**
  253.      * @return string|null
  254.      */
  255.     public function getAnafCodPostal(): ?string
  256.     {
  257.         return $this->anafCodPostal;
  258.     }
  259.     /**
  260.      * @param string|null $anafCodPostal
  261.      */
  262.     public function setAnafCodPostal(?string $anafCodPostal): void
  263.     {
  264.         $this->anafCodPostal $anafCodPostal;
  265.     }
  266.     /**
  267.      * @ORM\ManyToOne(targetEntity=CompanyType::class, inversedBy="companies")
  268.      * @ORM\JoinColumn(nullable=false, options={"default":1})
  269.      */
  270.     private $companyType;
  271.     public function __construct()
  272.     {
  273.         $this->contracts = new ArrayCollection();
  274.         $this->facturiHeaders = new ArrayCollection();
  275.         $this->payments = new ArrayCollection();
  276.         $this->cashIns = new ArrayCollection();
  277.         $this->cashOuts = new ArrayCollection();
  278.     }
  279.     public function getName(): ?string
  280.     {
  281.         return $this->name;
  282.     }
  283.     public function setName(string $name): self
  284.     {
  285.         $this->name $name;
  286.         return $this;
  287.     }
  288.     public function getCodFiscal(): ?string
  289.     {
  290.         return $this->codFiscal;
  291.     }
  292.     public function setCodFiscal(string $codFiscal): self
  293.     {
  294.         $this->codFiscal $codFiscal;
  295.         return $this;
  296.     }
  297.     public function getNrRegCom(): ?string
  298.     {
  299.         return $this->nrRegCom;
  300.     }
  301.     public function setNrRegCom(?string $nrRegCom): self
  302.     {
  303.         $this->nrRegCom $nrRegCom;
  304.         return $this;
  305.     }
  306.     public function getId(): int
  307.     {
  308.         return $this->id;
  309.     }
  310.     public function setId(int $id): void
  311.     {
  312.         $this->id $id;
  313.     }
  314.     public function getAddress(): ?string
  315.     {
  316.         return $this->address;
  317.     }
  318.     public function setAddress(string $address): self
  319.     {
  320.         $this->address $address;
  321.         return $this;
  322.     }
  323.     public function getBanca(): ?string
  324.     {
  325.         return $this->banca;
  326.     }
  327.     public function setBanca(?string $banca): self
  328.     {
  329.         $this->banca $banca;
  330.         return $this;
  331.     }
  332.     public function getContBancar(): ?string
  333.     {
  334.         return $this->contBancar;
  335.     }
  336.     public function setContBancar(?string $contBancar): self
  337.     {
  338.         $this->contBancar $contBancar;
  339.         return $this;
  340.     }
  341.     public function getContactPerson(): ?string
  342.     {
  343.         return $this->contactPerson;
  344.     }
  345.     public function setContactPerson(?string $contactPerson): self
  346.     {
  347.         $this->contactPerson $contactPerson;
  348.         return $this;
  349.     }
  350.     public function getContactPersonTitle()
  351.     {
  352.         return $this->contactPersonTitle;
  353.     }
  354.     public function setContactPersonTitle($contactPersonTitle): void
  355.     {
  356.         $this->contactPersonTitle $contactPersonTitle;
  357.     }
  358.     public function getTel(): ?string
  359.     {
  360.         return $this->tel;
  361.     }
  362.     public function setTel(?string $tel): self
  363.     {
  364.         $this->tel $tel;
  365.         return $this;
  366.     }
  367.     public function getEmail(): ?string
  368.     {
  369.         return $this->email;
  370.     }
  371.     public function setEmail(?string $email): self
  372.     {
  373.         $this->email $email;
  374.         return $this;
  375.     }
  376.     /**
  377.      * @return Collection<int, Contract>
  378.      */
  379.     public function getContract(): Collection
  380.     {
  381.         return $this->contracts;
  382.     }
  383.     public function addContract(Contract $contract): self
  384.     {
  385.         if (!$this->contracts->contains($contract)) {
  386.             $this->contracts[] = $contract;
  387.             $contract->setCompany($this);
  388.         }
  389.         return $this;
  390.     }
  391.     public function removeContract(Contract $contract): self
  392.     {
  393.         if ($this->contracts->removeElement($contract)) {
  394.             // set the owning side to null (unless already changed)
  395.             if ($contract->getCompany() === $this) {
  396.                 $contract->setCompany(null);
  397.             }
  398.         }
  399.         return $this;
  400.     }
  401.     public function getType(): ?int
  402.     {
  403.         return $this->type;
  404.     }
  405.     public function setType(int $type): self
  406.     {
  407.         $this->type $type;
  408.         return $this;
  409.     }
  410.     /**
  411.      * @return Collection<int, FacturiHeader>
  412.      */
  413.     public function getFacturiHeaders(): Collection
  414.     {
  415.         return $this->facturiHeaders;
  416.     }
  417.     public function addFacturiHeader(FacturiHeader $facturiHeader): self
  418.     {
  419.         if (!$this->facturiHeaders->contains($facturiHeader)) {
  420.             $this->facturiHeaders[] = $facturiHeader;
  421.             $facturiHeader->setCompany($this);
  422.         }
  423.         return $this;
  424.     }
  425.     public function removeFacturiHeader(FacturiHeader $facturiHeader): self
  426.     {
  427.         if ($this->facturiHeaders->removeElement($facturiHeader)) {
  428.             // set the owning side to null (unless already changed)
  429.             if ($facturiHeader->getCompany() === $this) {
  430.                 $facturiHeader->setCompany(null);
  431.             }
  432.         }
  433.         return $this;
  434.     }
  435.     public function isDeleted(): ?bool
  436.     {
  437.         return $this->deleted;
  438.     }
  439.     public function setDeleted(bool $deleted): self
  440.     {
  441.         $this->deleted $deleted;
  442.         return $this;
  443.     }
  444.     /**
  445.      * @return Collection<int, Payment>
  446.      */
  447.     public function getPayments(): Collection
  448.     {
  449.         return $this->payments;
  450.     }
  451.     public function addPayment(Payment $payment): self
  452.     {
  453.         if (!$this->payments->contains($payment)) {
  454.             $this->payments[] = $payment;
  455.             $payment->setCompany($this);
  456.         }
  457.         return $this;
  458.     }
  459.     public function removePayment(Payment $payment): self
  460.     {
  461.         if ($this->payments->removeElement($payment)) {
  462.             // set the owning side to null (unless already changed)
  463.             if ($payment->getCompany() === $this) {
  464.                 $payment->setCompany(null);
  465.             }
  466.         }
  467.         return $this;
  468.     }
  469.     public function isPayerTva(): ?bool
  470.     {
  471.         return $this->payerTva;
  472.     }
  473.     public function setPayerTva(bool $payerTva): self
  474.     {
  475.         $this->payerTva $payerTva;
  476.         return $this;
  477.     }
  478.     public function __toString(): string
  479.     {
  480.         return $this->getName();
  481.     }
  482.     public function getCountry(): ?Country
  483.     {
  484.         return $this->country;
  485.     }
  486.     public function setCountry(?Country $country): self
  487.     {
  488.         $this->country $country;
  489.         return $this;
  490.     }
  491.     public function isBillWithTva(): ?bool
  492.     {
  493.         return $this->billWithTva;
  494.     }
  495.     public function setBillWithTva(?bool $billWithTva): self
  496.     {
  497.         $this->billWithTva $billWithTva;
  498.         return $this;
  499.     }
  500.     public function isZeroTva(): ?bool
  501.     {
  502.         return $this->zeroTva;
  503.     }
  504.     public function setZeroTva(?bool $zeroTva): self
  505.     {
  506.         $this->zeroTva $zeroTva;
  507.         return $this;
  508.     }
  509.     /**
  510.      * @return Collection<int, CashIn>
  511.      */
  512.     public function getCashIns(): Collection
  513.     {
  514.         return $this->cashIns;
  515.     }
  516.     public function addCashIn(CashIn $cashIn): self
  517.     {
  518.         if (!$this->cashIns->contains($cashIn)) {
  519.             $this->cashIns[] = $cashIn;
  520.             $cashIn->setCompany($this);
  521.         }
  522.         return $this;
  523.     }
  524.     public function removeCashIn(CashIn $cashIn): self
  525.     {
  526.         if ($this->cashIns->removeElement($cashIn)) {
  527.             // set the owning side to null (unless already changed)
  528.             if ($cashIn->getCompany() === $this) {
  529.                 $cashIn->setCompany(null);
  530.             }
  531.         }
  532.         return $this;
  533.     }
  534.     /**
  535.      * @return Collection<int, CashOut>
  536.      */
  537.     public function getCashOuts(): Collection
  538.     {
  539.         return $this->cashOuts;
  540.     }
  541.     public function addCashOut(CashOut $cashOut): self
  542.     {
  543.         if (!$this->cashOuts->contains($cashOut)) {
  544.             $this->cashOuts[] = $cashOut;
  545.             $cashOut->setCompany($this);
  546.         }
  547.         return $this;
  548.     }
  549.     public function removeCashOut(CashOut $cashOut): self
  550.     {
  551.         if ($this->cashOuts->removeElement($cashOut)) {
  552.             // set the owning side to null (unless already changed)
  553.             if ($cashOut->getCompany() === $this) {
  554.                 $cashOut->setCompany(null);
  555.             }
  556.         }
  557.         return $this;
  558.     }
  559.     public function getCompanyType(): ?CompanyType
  560.     {
  561.         return $this->companyType;
  562.     }
  563.     public function setCompanyType(?CompanyType $companyType): self
  564.     {
  565.         $this->companyType $companyType;
  566.         return $this;
  567.     }
  568.     /**
  569.      * @return Collection
  570.      */
  571.     public function getContracts(): Collection
  572.     {
  573.         return $this->contracts;
  574.     }
  575.     /**
  576.      * @param Collection $contracts
  577.      */
  578.     public function setContracts(Collection $contracts): void
  579.     {
  580.         $this->contracts $contracts;
  581.     }
  582. }