src/Entity/Company.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Application\Application;
  4. use Doctrine\Common\Collections\Criteria;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Company
  8.  *
  9.  * @ORM\Table(name="company")
  10.  * @ORM\Entity(repositoryClass="App\Repository\CompanyRepository")
  11.  */
  12. class Company
  13. {
  14.     /**
  15.      * @var \Ramsey\Uuid\UuidInterface
  16.      *
  17.      * @ORM\Id
  18.      *  @ORM\Column(type="uuid", unique=true)
  19.      * @ORM\GeneratedValue(strategy="CUSTOM")
  20.      * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var string
  25.      *
  26.      * @ORM\Column(name="name", type="string", length=50)
  27.      */
  28.     private $name;
  29.     /**
  30.      * @var int
  31.      *
  32.      * @ORM\Column(name="telephone", type="integer", nullable=true)
  33.      */
  34.     private $telephone;
  35.     /**
  36.      * @var int
  37.      *
  38.      * @ORM\Column(name="telephone_main", type="integer", nullable=true)
  39.      */
  40.     private $telephoneMain;
  41.     /**
  42.      * @var int
  43.      *
  44.      * @ORM\Column(name="telephone_master", type="integer", nullable=true)
  45.      */
  46.     private $telephoneMaster;
  47.     /**
  48.      * @var int
  49.      *
  50.      * @ORM\Column(name="telephone_slave", type="integer", nullable=true)
  51.      */
  52.     private $telephoneSlave;
  53.     /**
  54.      * @var string
  55.      *
  56.      * @ORM\Column(name="email_main", type="string", length=50, nullable=true)
  57.      */
  58.     private $emailMain;
  59.     /**
  60.      * @var string
  61.      *
  62.      * @ORM\Column(name="email_slave", type="string", length=50, nullable=true)
  63.      */
  64.     private $emailSlave;
  65.     /**
  66.      * @var string
  67.      *
  68.      * @ORM\Column(name="website", type="string", length=50, nullable=true)
  69.      */
  70.     private $website;
  71.     /**
  72.      * @var string
  73.      *
  74.      * @ORM\Column(name="licenca", type="string", length=1000, nullable=true)
  75.      */
  76.     private $licenca;
  77.     /**
  78.      * @var string
  79.      *
  80.      * @ORM\Column(name="valid", type="string", length=50, nullable=true)
  81.      */
  82.     private $valid;
  83.     /**
  84.      * @var string
  85.      *
  86.      * @ORM\Column(name="nif", type="string", length=50, nullable=false)
  87.      */
  88.     private $nif;
  89.     /**
  90.      * @var string
  91.      *
  92.      * @ORM\Column(name="slogan", type="string", length=100, nullable=true)
  93.      */
  94.     private $slogan;
  95.     /**
  96.      * @var string
  97.      *
  98.      * @ORM\Column(name="logo", type="text", length=5000, nullable=true)
  99.      */
  100.     private $logo;
  101.     /**
  102.      * @var string
  103.      *
  104.      * @ORM\Column(name="fullName", type="string", length=255, nullable=true)
  105.      */
  106.     private $fullName;
  107.     /**
  108.      * @var string
  109.      *
  110.      * @ORM\Column(name="fax", type="string", length=255, nullable=true)
  111.      */
  112.     private $fax;
  113.     /**
  114.      * @var string
  115.      *
  116.      * @ORM\Column(name="capitalSocial", type="string", length=255, nullable=true)
  117.      */
  118.     private $capitalSocial;
  119.     /**
  120.      * @var string
  121.      *
  122.      * @ORM\Column(name="endereco", type="string", length=255, nullable=true)
  123.      */
  124.     private $endereco;
  125.     /**
  126.      * @ORM\OneToMany(targetEntity="App\Entity\ContaBancaria", mappedBy="contasBancarias")
  127.      */
  128.     private $contasBancarias;
  129.     /**
  130.      * @ORM\OneToMany(targetEntity="App\Entity\PlanCounter", mappedBy="company")
  131.      * @ORM\OrderBy({"dueDate" = "DESC"})
  132.      */
  133.     private $plans;
  134.     private $plan;
  135.     /**
  136.      * @ORM\OneToMany(targetEntity="App\Entity\TaxData", mappedBy="company")
  137.      */
  138.     private $taxData;
  139.     /**
  140.      * @ORM\ManyToOne(targetEntity="App\Entity\Address", cascade={"persist"})
  141.      */
  142.     private $address;
  143.     /**
  144.      * @ORM\ManyToOne(targetEntity="App\Entity\TaxExemption", cascade={"persist"})
  145.      */
  146.     private $taxRegim;
  147.     /**
  148.      * @var string
  149.      *
  150.      * @ORM\Column(name="id_tipo", type="string", nullable=true, length=100, unique=false)
  151.      */
  152.     private $idType;
  153.     /**
  154.      * @var string
  155.      *
  156.      * @ORM\Column(name="sharedware_house", type="boolean")
  157.      */
  158.     private $sharedwareHouse;
  159.     /**
  160.      * @var int
  161.      *
  162.      * @ORM\Column(name="privacity", type="integer", nullable=true)
  163.      */
  164.     private $privacity;
  165.     /**
  166.      * @var \DateTime
  167.      */
  168.     private $licenseDate;
  169.     /**
  170.      * @return string
  171.      */
  172.     public function getNif()
  173.     {
  174.         return $this->nif;
  175.     }
  176.     /**
  177.      * @param mixed $nif
  178.      */
  179.     public function setNif($nif)
  180.     {
  181.         $this->nif $nif;
  182.     }
  183.     /**
  184.      * @return mixed
  185.      */
  186.     public function getCapitalSocial()
  187.     {
  188.         return $this->capitalSocial;
  189.     }
  190.     /**
  191.      * @param mixed $capitalSocial
  192.      */
  193.     public function setCapitalSocial($capitalSocial)
  194.     {
  195.         $this->capitalSocial $capitalSocial;
  196.     }
  197.     /**
  198.      * @return mixed
  199.      */
  200.     public function getEndereco()
  201.     {
  202.         return $this->endereco;
  203.     }
  204.     /**
  205.      * @param mixed $endereco
  206.      */
  207.     public function setEndereco($endereco)
  208.     {
  209.         $this->endereco $endereco;
  210.     }
  211.     /**
  212.      * @return mixed
  213.      */
  214.     public function getProvincia()
  215.     {
  216.         return $this->provincia;
  217.     }
  218.     /**
  219.      * @param mixed $provincia
  220.      */
  221.     public function setProvincia($provincia)
  222.     {
  223.         $this->provincia $provincia;
  224.     }
  225.     /**
  226.      * @return string
  227.      */
  228.     public function getPais()
  229.     {
  230.         return $this->pais;
  231.     }
  232.     /**
  233.      * @param string $pais
  234.      */
  235.     public function setPais(string $pais)
  236.     {
  237.         $this->pais $pais;
  238.     }
  239.     /**
  240.      * @return Diversos
  241.      */
  242.     public function getDiversos()
  243.     {
  244.         return $this->diversos;
  245.     }
  246.     /**
  247.      * @param mixed $diversos
  248.      */
  249.     public function setDiversos($diversos)
  250.     {
  251.         $this->diversos $diversos;
  252.     }
  253.     /**
  254.      * @var string
  255.      *
  256.      * @ORM\Column(name="provincia", type="string", length=255, nullable=true)
  257.      */
  258.     private $provincia;
  259.     /**
  260.      * @return string
  261.      */
  262.     public function getLicenca()
  263.     {
  264.         return $this->licenca;
  265.     }
  266.     /**
  267.      * @param string $licenca
  268.      * @return Company
  269.      */
  270.     public function setLicenca($licenca)
  271.     {
  272.         if (!is_null($licenca))
  273.             $this->licenca $licenca;
  274.         return $this;
  275.     }
  276.     /**
  277.      * @return string
  278.      */
  279.     public function getWebsite()
  280.     {
  281.         return $this->website;
  282.     }
  283.     /**
  284.      * @param string $website
  285.      */
  286.     public function setWebsite(string $website)
  287.     {
  288.         $this->website $website;
  289.     }
  290.     /**
  291.      * @var string
  292.      *
  293.      * @ORM\Column(name="pais", type="string", length=255, nullable=true)
  294.      */
  295.     private $pais;
  296.     /**
  297.      * @ORM\ManyToOne(targetEntity="App\Entity\Diversos")
  298.      */
  299.     private $diversos;
  300.     /**
  301.      * @ORM\ManyToOne(targetEntity="App\Entity\DocumentSettings")
  302.      */
  303.     private $settings;
  304.     /**
  305.      * @return DocumentSettings
  306.      */
  307.     public function getSettings()
  308.     {
  309.         return $this->settings;
  310.     }
  311.     /**
  312.      * @param mixed $settings
  313.      */
  314.     public function setSettings($settings)
  315.     {
  316.         $this->settings $settings;
  317.     }
  318.     /**
  319.      * @return Moeda
  320.      */
  321.     public function getMoeda()
  322.     {
  323.         return '';//$this->moeda;
  324.     }
  325.     /**
  326.      * Get id
  327.      *
  328.      * @return int
  329.      */
  330.     public function getId()
  331.     {
  332.         return $this->id;
  333.     }
  334.     /**
  335.      * Set name
  336.      *
  337.      * @param string $name
  338.      *
  339.      * @return Company
  340.      */
  341.     public function setName($name)
  342.     {
  343.         $this->name $name;
  344.         return $this;
  345.     }
  346.     /**
  347.      * Get name
  348.      *
  349.      * @return string
  350.      */
  351.     public function getName()
  352.     {
  353.         return $this->name;
  354.     }
  355.     /**
  356.      * Set telephone
  357.      *
  358.      * @param integer $telephone
  359.      *
  360.      * @return Company
  361.      */
  362.     public function setTelephone($telephone)
  363.     {
  364.         $this->telephone $telephone;
  365.         return $this;
  366.     }
  367.     /**
  368.      * Get telephone
  369.      *
  370.      * @return int
  371.      */
  372.     public function getTelephone()
  373.     {
  374.         return $this->telephone;
  375.     }
  376.     /**
  377.      * Set telephoneMain
  378.      *
  379.      * @param integer $telephoneMain
  380.      *
  381.      * @return Company
  382.      */
  383.     public function setTelephoneMain($telephoneMain)
  384.     {
  385.         $this->telephoneMain $telephoneMain;
  386.         return $this;
  387.     }
  388.     /**
  389.      * Get telephoneMain
  390.      *
  391.      * @return int
  392.      */
  393.     public function getTelephoneMain()
  394.     {
  395.         return $this->telephoneMain;
  396.     }
  397.     /**
  398.      * Set telephoneMaster
  399.      *
  400.      * @param integer $telephoneMaster
  401.      *
  402.      * @return Company
  403.      */
  404.     public function setTelephoneMaster($telephoneMaster)
  405.     {
  406.         $this->telephoneMaster $telephoneMaster;
  407.         return $this;
  408.     }
  409.     /**
  410.      * Get telephoneMaster
  411.      *
  412.      * @return int
  413.      */
  414.     public function getTelephoneMaster()
  415.     {
  416.         return $this->telephoneMaster;
  417.     }
  418.     /**
  419.      * Set telephoneSlave
  420.      *
  421.      * @param integer $telephoneSlave
  422.      *
  423.      * @return Company
  424.      */
  425.     public function setTelephoneSlave($telephoneSlave)
  426.     {
  427.         $this->telephoneSlave $telephoneSlave;
  428.         return $this;
  429.     }
  430.     /**
  431.      * Get telephoneSlave
  432.      *
  433.      * @return int
  434.      */
  435.     public function getTelephoneSlave()
  436.     {
  437.         return $this->telephoneSlave;
  438.     }
  439.     /**
  440.      * Set emailMain
  441.      *
  442.      * @param string $emailMain
  443.      *
  444.      * @return Company
  445.      */
  446.     public function setEmailMain($emailMain)
  447.     {
  448.         $this->emailMain $emailMain;
  449.         return $this;
  450.     }
  451.     /**
  452.      * Get emailMain
  453.      *
  454.      * @return string
  455.      */
  456.     public function getEmailMain()
  457.     {
  458.         return $this->emailMain;
  459.     }
  460.     /**
  461.      * Set emailSlave
  462.      *
  463.      * @param string $emailSlave
  464.      *
  465.      * @return Company
  466.      */
  467.     public function setEmailSlave($emailSlave)
  468.     {
  469.         $this->emailSlave $emailSlave;
  470.         return $this;
  471.     }
  472.     /**
  473.      * Get emailSlave
  474.      *
  475.      * @return string
  476.      */
  477.     public function getEmailSlave()
  478.     {
  479.         return $this->emailSlave;
  480.     }
  481.     /**
  482.      * Set slogan
  483.      *
  484.      * @param string $slogan
  485.      *
  486.      * @return Company
  487.      */
  488.     public function setSlogan($slogan)
  489.     {
  490.         $this->slogan $slogan;
  491.         return $this;
  492.     }
  493.     /**
  494.      * Get slogan
  495.      *
  496.      * @return string
  497.      */
  498.     public function getSlogan()
  499.     {
  500.         return $this->slogan;
  501.     }
  502.     /**
  503.      * Set fullName
  504.      *
  505.      * @param string $fullName
  506.      *
  507.      * @return Company
  508.      */
  509.     public function setFullName($fullName)
  510.     {
  511.         $this->fullName $fullName;
  512.         return $this;
  513.     }
  514.     /**
  515.      * Get fullName
  516.      *
  517.      * @return string
  518.      */
  519.     public function getFullName()
  520.     {
  521.         return $this->fullName;
  522.     }
  523.     /**
  524.      * Set fax
  525.      *
  526.      * @param string $fax
  527.      *
  528.      * @return Company
  529.      */
  530.     public function setFax($fax)
  531.     {
  532.         $this->fax $fax;
  533.         return $this;
  534.     }
  535.     /**
  536.      * Get fax
  537.      *
  538.      * @return string
  539.      */
  540.     public function getFax()
  541.     {
  542.         return $this->fax;
  543.     }
  544.     /**
  545.      * @return []
  546.      */
  547.     public function getContasBancarias()
  548.     {
  549.         return $this->contasBancarias;
  550.     }
  551.     /**
  552.      * @param mixed $contasBancarias
  553.      */
  554.     public function setContasBancarias($contasBancarias)
  555.     {
  556.         $this->contasBancarias $contasBancarias;
  557.     }
  558.     /**
  559.      * @return TaxData
  560.      */
  561.     public function getTaxData()
  562.     {
  563.         return $this->taxData;
  564.     }
  565.     /**
  566.      * @param TaxData $taxData
  567.      */
  568.     public function setTaxData($taxData)
  569.     {
  570.         $this->taxData $taxData;
  571.     }
  572.     /**
  573.      * @return Address
  574.      */
  575.     public function getAddress()
  576.     {
  577.         return is_null($this->address) ?  new Address() : $this->address;
  578.     }
  579.     /**
  580.      * @param mixed $address
  581.      */
  582.     public function setAddress($address)
  583.     {
  584.         $this->address $address;
  585.     }
  586.     /**
  587.      * @return string
  588.      */
  589.     public function getValid()
  590.     {
  591.         return $this->valid;
  592.     }
  593.     /**
  594.      * @param string $valid
  595.      * @return Company
  596.      */
  597.     public function setValid($valid)
  598.     {
  599.         $this->valid $valid;
  600.         return $this;
  601.     }
  602.     /**
  603.      * @return PlanCounter[]
  604.      */
  605.     public function getPlans()
  606.     {
  607.         return $this->plans;
  608.     }
  609.     /**
  610.      * @param []PlanCounter $plan
  611.      */
  612.     public function setPlans($plans)
  613.     {
  614.         $this->plans $plans;
  615.     }
  616.     /**
  617.      * @return string
  618.      */
  619.     public function getIdType()
  620.     {
  621.         return $this->idType;
  622.     }
  623.     /**
  624.      * @param string $id_tipo
  625.      */
  626.     public function setIdType($id_tipo)
  627.     {
  628.         $this->idType $id_tipo;
  629.     }
  630.     public function getLicenseDate()
  631.     {
  632.         return Application::licenseDate($this);
  633.     }
  634.     /**
  635.      * @param string $licenseDate
  636.      * @return $this
  637.      */
  638.     public function setLicenseDate($licenseDate)
  639.     {
  640.         return $this;
  641.     }
  642.     /**
  643.      * @return TaxExemption
  644.      */
  645.     public function getTaxRegim()
  646.     {
  647.         return $this->taxRegim;
  648.     }
  649.     /**
  650.      * @param TaxExemption $taxRegim
  651.      * @return Company
  652.      */
  653.     public function setTaxRegim($taxRegim)
  654.     {
  655.         $this->taxRegim $taxRegim;
  656.         return $this;
  657.     }
  658.     /**
  659.      * @return PlanCounter
  660.      */
  661.     public function getPlan()
  662.     {
  663.         /**
  664.          * @var PlanCounter $plan
  665.          */
  666.         foreach ($this->getPlans() as $plan)
  667.             if ($plan->getDueDate() > new \DateTime() and !empty($plan->getLicense()))
  668.                 return $this->plan $plan;
  669.         return new PlanCounter();
  670.     }
  671.     /**
  672.      * @return string
  673.      */
  674.     public function getLogo()
  675.     {
  676.         return $this->logo;
  677.     }
  678.     /**
  679.      * @param string $logo
  680.      */
  681.     public function setLogo($logo)
  682.     {
  683.         $this->logo $logo;
  684.     }
  685.     /**
  686.      */
  687.     public function isSharedWareHouse()
  688.     {
  689.         return $this->sharedwareHouse;
  690.     }
  691.     /**
  692.      * @param  $is
  693.      * @return Company
  694.      */
  695.     public function setSharedWareHouse($is)
  696.     {
  697.         $this->sharedwareHouse $is;
  698.         return $this;
  699.     }
  700.     /**
  701.      * Get the value of privacity
  702.      *
  703.      * @return  int
  704.      */
  705.     public function getPrivacity()
  706.     {
  707.         return $this->privacity ?? 0;
  708.     }
  709.     /**
  710.      * Set the value of privacity
  711.      *
  712.      * @param  int  $privacity
  713.      *
  714.      * @return  self
  715.      */
  716.     public function setPrivacity(int $privacity)
  717.     {
  718.         $this->privacity $privacity;
  719.         return $this;
  720.     }
  721. }