src/Entity/Supplier.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SupplierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use JMS\Serializer\Annotation as Serializer;
  8. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use Tionvel\ImporterBundle\Validator as TionvelAssert;
  11. use Symfony\Component\HttpFoundation\File\File;
  12. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  13. /**
  14.  * @Serializer\ExclusionPolicy("ALL")
  15.  * @Gedmo\Loggable()
  16.  */
  17. #[Vich\Uploadable]
  18. #[UniqueEntity(fields: ["rut"], message"Ya existe un proveedor con este RUT")]
  19. #[UniqueEntity(fields: ["email"], message"Ya existe un proveedor con este email")]
  20. #[UniqueEntity(fields: ["username"], message"Ya existe un proveedor con este nombre de usuario")]
  21. #[ORM\Entity(repositoryClassSupplierRepository::class)]
  22. #[ORM\Table(name'`supplier`')]
  23. class Supplier
  24. {
  25.     /**
  26.      * @Serializer\Expose()
  27.      */
  28.     #[ORM\Id]
  29.     #[ORM\GeneratedValue(strategy:"AUTO")]
  30.     #[ORM\Column(type"integer")]
  31.     protected ?int $id null;
  32.     /**
  33.      * @Gedmo\Versioned()
  34.      */
  35.     #[ORM\Column(type"boolean")]
  36.     protected $enabled true;
  37.     #[ORM\OneToOne(inversedBy"supplier"targetEntity"App\Entity\User"cascade: ["persist"])]
  38.     #[ORM\JoinColumn(onDelete"CASCADE")]
  39.     protected $user;
  40.     /**
  41.      * @Serializer\Expose()
  42.      * @Gedmo\Versioned()
  43.      */
  44.     #[Assert\NotBlank(message"El Nombre no puede estar en blanco" )]
  45.     #[ORM\Column(type"string"length300)]
  46.     protected $name;
  47.     /**
  48.      * @Serializer\Expose()
  49.      * @Gedmo\Versioned()
  50.      */
  51.     #[TionvelAssert\Rut]
  52.     #[Assert\NotBlank(message"El rut no puede estar en blanco" )]
  53.     #[ORM\Column(type"string"length20)]
  54.     protected $rut;
  55.     /**
  56.      * @Serializer\Expose()
  57.      * @Gedmo\Versioned()
  58.      */
  59.     #[Assert\Length(max40)]
  60.     #[ORM\Column(type"string"length60nullabletrue )]
  61.     protected $phone;
  62.     /**
  63.      * @Serializer\Expose()
  64.      * @Gedmo\Versioned()
  65.      */
  66.     #[Assert\Length(max300)]
  67.     #[ORM\Column(type"string"length300nullabletrue )]
  68.     protected $address;
  69.     /**
  70.      * @Serializer\Expose()
  71.      * @Gedmo\Versioned()
  72.      */
  73.     #[Assert\NotBlank(message"La comuna no puede estar en blanco" )]
  74.     #[ORM\ManyToOne(targetEntity:"City")]
  75.     #[ORM\JoinColumn(nullabletrueonDelete"SET NULL")]
  76.     protected $city;
  77.     /**
  78.      * @Serializer\Expose()
  79.      * @Gedmo\Versioned()
  80.      */
  81.     #[Assert\Length(max300)]
  82.     #[ORM\Column(type"string"length1000nullabletrue )]
  83.     protected $website;
  84.     /**
  85.      * @Serializer\Expose()
  86.      * @Gedmo\Versioned()
  87.      */
  88.     #[Assert\Length(max1000)]
  89.     #[ORM\Column(type"text"nullabletrue )]
  90.     protected $excerpt;
  91.     #[ORM\ManyToMany(targetEntity:"City")]
  92.     #[ORM\JoinTable(name"supplier_regions")]
  93.     protected $regions;
  94.     #[ORM\ManyToMany(targetEntity:"Category")]
  95.     #[ORM\JoinTable(name"supplier_categories")]
  96.     protected $categories;
  97.     /**
  98.      * @Gedmo\Versioned()
  99.      */
  100.     #[ORM\Column(type"boolean")]
  101.     protected $isPyme false;
  102.     #[ORM\Column(type"boolean")]
  103.     protected $isCp false;
  104.     /**
  105.      * @Gedmo\Versioned()
  106.      */
  107.     #[ORM\Column(type"boolean")]
  108.     protected $isPep false;
  109.     /**
  110.      * @Gedmo\Versioned()
  111.      */
  112.     #[ORM\Column(type"boolean")]
  113.     protected $isLey false;
  114.     /**
  115.      * @Gedmo\Versioned()
  116.      */
  117.     #[ORM\Column(type"boolean")]
  118.     protected $isWomanCompany false;
  119.     #[ORM\Column(type"string"length255nullabletrue)]
  120.     protected $womanCompanyDocument null;
  121.     #[Vich\UploadableField(mapping"supplier_certifications"fileNameProperty"womanCompanyDocument")]
  122.     protected $womanCompanyDocumentFile;
  123.     #[ORM\Column(type"datetime"nullabletrue)]
  124.     protected $womanCompanyDocumentUpdatedAt;
  125.     /**
  126.      * @Gedmo\Versioned()
  127.      */
  128.     #[ORM\Column(type"boolean")]
  129.     protected $hasLaborInclusionLaw21015 false;
  130.     #[ORM\Column(type"string"length255nullabletrue)]
  131.     protected $laborInclusionDocument null;
  132.     #[Vich\UploadableField(mapping"supplier_certifications"fileNameProperty"laborInclusionDocument")]
  133.     protected $laborInclusionDocumentFile;
  134.     #[ORM\Column(type"datetime"nullabletrue)]
  135.     protected $laborInclusionDocumentUpdatedAt;
  136.     /**
  137.      * @Gedmo\Versioned()
  138.      */
  139.     #[ORM\Column(type"boolean")]
  140.     protected $hasGenderEquity false;
  141.     #[ORM\Column(type"string"length255nullabletrue)]
  142.     protected $genderEquityDocument null;
  143.     #[Vich\UploadableField(mapping"supplier_certifications"fileNameProperty"genderEquityDocument")]
  144.     protected $genderEquityDocumentFile;
  145.     #[ORM\Column(type"datetime"nullabletrue)]
  146.     protected $genderEquityDocumentUpdatedAt;
  147.     /**
  148.      * @Gedmo\Versioned()
  149.      */
  150.     #[ORM\Column(type"boolean")]
  151.     protected $hasEnvironmentalPractices false;
  152.     #[ORM\Column(type"string"length255nullabletrue)]
  153.     protected $environmentalPracticesDocument null;
  154.     #[Vich\UploadableField(mapping"supplier_certifications"fileNameProperty"environmentalPracticesDocument")]
  155.     protected $environmentalPracticesDocumentFile;
  156.     #[ORM\Column(type"datetime"nullabletrue)]
  157.     protected $environmentalPracticesDocumentUpdatedAt;
  158.     #[ORM\Column(type"boolean")]
  159.     protected $hasNch3262 false;
  160.     #[ORM\Column(type"string"length255nullabletrue)]
  161.     protected $nch3262Document null;
  162.     #[Vich\UploadableField(mapping"supplier_certifications"fileNameProperty"nch3262Document")]
  163.     protected $nch3262DocumentFile;
  164.     #[ORM\Column(type"datetime"nullabletrue)]
  165.     protected $nch3262DocumentUpdatedAt;
  166.     /**
  167.      * @Gedmo\Versioned()
  168.      */
  169.     #[Assert\Email]
  170.     #[Assert\NotBlank]
  171.     #[ORM\Column(type"string")]
  172.     protected $email;
  173.     #[Assert\NotNull]
  174.     #[ORM\Column(type"string")]
  175.     protected $username;
  176.     /**
  177.      * @Serializer\Expose()
  178.      */
  179.     #[ORM\Column(type"json"nullabletrue)]
  180.     protected $rating = [];
  181.     /**
  182.      * @Serializer\Expose()
  183.      * @Gedmo\Versioned()
  184.      */
  185.     #[Assert\Length(min:2,max:64)]
  186.     #[ORM\Column(type"string"length64nullabletrue )]
  187.     protected $contactName;
  188.     /**
  189.      * @Serializer\Expose()
  190.      * @Gedmo\Versioned()
  191.      */
  192.     #[Assert\Length(min:2,max:64)]
  193.     #[ORM\Column(type"string"length64nullabletrue )]
  194.     protected $contactPosition;
  195.     /**
  196.      * @Serializer\Expose()
  197.      * @Gedmo\Versioned()
  198.      */
  199.     #[Assert\Length(min:2,max:64)]
  200.     #[ORM\Column(type"string"length64nullabletrue )]
  201.     protected $alternativeContactName;
  202.     /**
  203.      * @Serializer\Expose()
  204.      * @Gedmo\Versioned()
  205.      */
  206.     #[Assert\Length(max40)]
  207.     #[ORM\Column(type"string"length60nullabletrue )]
  208.     protected $alternativeContactPhone;
  209.     /**
  210.      * @Serializer\Expose()
  211.      * @Gedmo\Versioned()
  212.      */
  213.     #[Assert\Email]
  214.     #[ORM\Column(type"string"nullabletrue)]
  215.     protected $alternativeContactEmail;
  216.     /**
  217.      * @Serializer\Expose()
  218.      * @Gedmo\Versioned()
  219.      */
  220.     #[Assert\Length(min:2,max:64)]
  221.     #[ORM\Column(type"string"length64nullabletrue )]
  222.     protected $alternativeContactPosition;
  223.     #[ORM\Column(type"boolean")]
  224.     protected $available false;
  225.     /**
  226.      * @Gedmo\Versioned()
  227.      */
  228.     #[Assert\Length(max100)]
  229.     #[ORM\Column(type"string"length100nullabletrue )]
  230.     protected $paymentBank;
  231.     /**
  232.      * @Gedmo\Versioned()
  233.      */
  234.     #[Assert\Length(max100)]
  235.     #[ORM\Column(type"string"length100nullabletrue )]
  236.     protected $paymentAccountNumber;
  237.     /**
  238.      * @Gedmo\Versioned()
  239.      */
  240.     #[Assert\Length(max100)]
  241.     #[ORM\Column(type"string"length100nullabletrue )]
  242.     protected $paymentAccountType;
  243.     /**
  244.      * @Gedmo\Versioned()
  245.      */
  246.     #[Assert\Length(max100)]
  247.     #[ORM\Column(type"string"length100nullabletrue )]
  248.     protected $paymentEmail;
  249.         /**
  250.      * @Gedmo\Versioned()
  251.      */
  252.     #[Assert\Length(max100)]
  253.     #[ORM\Column(type"string"length100nullabletrue )]
  254.     protected $specialSituation;
  255.     #[ORM\Column(type"datetime"nullabletrue)]
  256.     protected $updatedAt;
  257.     #[ORM\ManyToOne(targetEntity:"App\Entity\User")]
  258.     protected $updatedBy;
  259.     #[ORM\OneToMany(targetEntity:"SupplierAdjudication"mappedBy"supplier")]
  260.     protected $supplierAdjudication;
  261.     #[ORM\OneToMany(targetEntity:"App\Entity\SupplierContract"mappedBy"supplier"fetch"EXTRA_LAZY"orphanRemovaltruecascade: ['persist'])]
  262.     protected $contracts;
  263.     #[ORM\OneToMany(targetEntity:"App\Entity\SupplierDocument"mappedBy"supplier"fetch"EXTRA_LAZY"orphanRemovaltruecascade: ['persist'])]
  264.     protected $documents;
  265.     public function __construct()
  266.     {
  267.         $this->regions = new ArrayCollection();
  268.         $this->categories = new ArrayCollection();
  269.         $this->contracts = new ArrayCollection();
  270.         $this->documents = new ArrayCollection();
  271.     }
  272.     public function getId()
  273.     {
  274.         return $this->id;
  275.     }
  276.     public function getEnabled()
  277.     {
  278.         return $this->enabled;
  279.     }
  280.     public function setEnabled($enabled)
  281.     {
  282.         $this->enabled $enabled;
  283.     }
  284.     public function setName($name)
  285.     {
  286.         $this->name $name;
  287.     }
  288.     public function getName()
  289.     {
  290.         return $this->name;
  291.     }
  292.     public function setRut($rut)
  293.     {
  294.         $this->rut $rut;
  295.         if(!$this->username){
  296.             $username explode('-'$rut)[0];
  297.             $this->setUsername($username);
  298.         }
  299.     }
  300.     public function getRut()
  301.     {
  302.         return $this->rut;
  303.     }
  304.     public function setPhone($phone)
  305.     {
  306.         $this->phone $phone;
  307.     }
  308.     public function getPhone()
  309.     {
  310.         return $this->phone;
  311.     }
  312.     public function getAddress()
  313.     {
  314.         return $this->address;
  315.     }
  316.     public function setAddress($address)
  317.     {
  318.         $this->address $address;
  319.     }
  320.     public function setWebsite($website)
  321.     {
  322.         $this->website $website;
  323.     }
  324.     public function getWebsite()
  325.     {
  326.         return $this->website;
  327.     }
  328.     public function setExcerpt($excerpt)
  329.     {
  330.         $this->excerpt $excerpt;
  331.     }
  332.     public function getExcerpt()
  333.     {
  334.         return $this->excerpt;
  335.     }
  336.     public function setCity(City $city null)
  337.     {
  338.         $this->city $city;
  339.     }
  340.     public function getCity()
  341.     {
  342.         return $this->city;
  343.     }
  344.     /**
  345.      * @return \App\Entity\User
  346.      */
  347.     public function getUser()
  348.     {
  349.         return $this->user;
  350.     }
  351.     public function setUser(User $user)
  352.     {
  353.         $this->user $user;
  354.     }
  355.     public function setRating($rating)
  356.     {
  357.         $this->rating $rating;
  358.     }
  359.     public function getRating()
  360.     {
  361.         return $this->rating;
  362.     }
  363.     public function __toString()
  364.     {
  365.         return $this->name;
  366.     }
  367.     public function getFullAddress()
  368.     {
  369.         return sprintf('%s, %s, %s'$this->address$this->city->getName(), $this->city->getParent()->getName());
  370.     }
  371.     public function getRegions()
  372.     {
  373.         return $this->regions;
  374.     }
  375.     public function setRegions($regions)
  376.     {
  377.         $this->regions $regions;
  378.     }
  379.     public function addRegion(City $city)
  380.     {
  381.         if (!$this->regions->contains($city)) {
  382.             $this->regions->add($city);
  383.         }
  384.     }
  385.     public function removeRegion(City $city)
  386.     {
  387.         if ($this->regions->contains($city)) {
  388.             $this->regions->removeElement($city);
  389.         }
  390.     }
  391.     public function getCategories()
  392.     {
  393.         return $this->categories;
  394.     }
  395.     public function setCategories($categories)
  396.     {
  397.         $this->categories->clear();
  398.         foreach ($this->categories as $category) {
  399.             $this->removeCategory($category);
  400.         }
  401.         $this->categories $categories;
  402.     }
  403.     public function addCategory(Category $category)
  404.     {
  405.         if (!$this->categories->contains($category)) {
  406.             $this->categories->add($category);
  407.         }
  408.     }
  409.     public function removeCategory(Category $category)
  410.     {
  411.         if ($this->categories->contains($category)) {
  412.             $this->categories->removeElement($category);
  413.         }
  414.     }
  415.     public function getIsPyme()
  416.     {
  417.         return $this->isPyme;
  418.     }
  419.     public function setIsPyme($isPyme)
  420.     {
  421.         $this->isPyme $isPyme;
  422.     }
  423.     public function getIsCp()
  424.     {
  425.         return $this->isCp;
  426.     }
  427.     public function setIsCp($isCp)
  428.     {
  429.         $this->isCp $isCp;
  430.     }
  431.     public function getIsPep()
  432.     {
  433.         return $this->isPep;
  434.     }
  435.     public function setIsPep($isPep)
  436.     {
  437.         $this->isPep $isPep;
  438.     }
  439.     public function getIsLey()
  440.     {
  441.         return $this->isLey;
  442.     }
  443.     public function setIsLey($isLey)
  444.     {
  445.         $this->isLey $isLey;
  446.     }
  447.     public function getIsWomanCompany()
  448.     {
  449.         return $this->isWomanCompany;
  450.     }
  451.     public function setIsWomanCompany($isWomanCompany)
  452.     {
  453.         $this->isWomanCompany $isWomanCompany;
  454.     }
  455.     public function getHasLaborInclusionLaw21015()
  456.     {
  457.         return $this->hasLaborInclusionLaw21015;
  458.     }
  459.     public function setHasLaborInclusionLaw21015($hasLaborInclusionLaw21015)
  460.     {
  461.         $this->hasLaborInclusionLaw21015 $hasLaborInclusionLaw21015;
  462.     }
  463.     public function getHasGenderEquity()
  464.     {
  465.         return $this->hasGenderEquity;
  466.     }
  467.     public function setHasGenderEquity($hasGenderEquity)
  468.     {
  469.         $this->hasGenderEquity $hasGenderEquity;
  470.     }
  471.     public function getHasEnvironmentalPractices()
  472.     {
  473.         return $this->hasEnvironmentalPractices;
  474.     }
  475.     public function setHasEnvironmentalPractices($hasEnvironmentalPractices)
  476.     {
  477.         $this->hasEnvironmentalPractices $hasEnvironmentalPractices;
  478.     }
  479.     public function getEmail()
  480.     {
  481.         return $this->email;
  482.     }
  483.     public function setEmail($email)
  484.     {
  485.         $this->email $email;
  486.     }
  487.     public function getUsername()
  488.     {
  489.         return $this->username;
  490.     }
  491.     public function setUsername($username)
  492.     {
  493.         $this->username $username;
  494.     }
  495.     /**
  496.      * @return mixed
  497.      */
  498.     public function getContactName()
  499.     {
  500.         return $this->contactName;
  501.     }
  502.     /**
  503.      * @param mixed $contactName
  504.      */
  505.     public function setContactName($contactName): void
  506.     {
  507.         $this->contactName $contactName;
  508.     }
  509.     /**
  510.      * @return mixed
  511.      */
  512.     public function getContactPosition()
  513.     {
  514.         return $this->contactPosition;
  515.     }
  516.     /**
  517.      * @param mixed $contactPosition
  518.      */
  519.     public function setContactPosition($contactPosition)
  520.     {
  521.         $this->contactPosition $contactPosition;
  522.     }
  523.     /**
  524.      * @return mixed
  525.      */
  526.     public function getAlternativeContactName()
  527.     {
  528.         return $this->alternativeContactName;
  529.     }
  530.     /**
  531.      * @param mixed $alternativeContactName
  532.      */
  533.     public function setAlternativeContactName($alternativeContactName): void
  534.     {
  535.         $this->alternativeContactName $alternativeContactName;
  536.     }
  537.     /**
  538.      * @return mixed
  539.      */
  540.     public function getAlternativeContactPhone()
  541.     {
  542.         return $this->alternativeContactPhone;
  543.     }
  544.     /**
  545.      * @param mixed $alternativeContactPhone
  546.      */
  547.     public function setAlternativeContactPhone($alternativeContactPhone): void
  548.     {
  549.         $this->alternativeContactPhone $alternativeContactPhone;
  550.     }
  551.     /**
  552.      * @return mixed
  553.      */
  554.     public function getAlternativeContactEmail()
  555.     {
  556.         return $this->alternativeContactEmail;
  557.     }
  558.     /**
  559.      * @param mixed $alternativeContactEmail
  560.      */
  561.     public function setAlternativeContactEmail($alternativeContactEmail): void
  562.     {
  563.         $this->alternativeContactEmail $alternativeContactEmail;
  564.     }
  565.     /**
  566.      * @return mixed
  567.      */
  568.     public function getAlternativeContactPosition()
  569.     {
  570.         return $this->alternativeContactPosition;
  571.     }
  572.     /**
  573.      * @param mixed $alternativeContactPosition
  574.      */
  575.     public function setAlternativeContactPosition($alternativeContactPosition): void
  576.     {
  577.         $this->alternativeContactPosition $alternativeContactPosition;
  578.     }
  579.     /**
  580.      * @return bool
  581.      */
  582.     public function isAvailable()
  583.     {
  584.         return $this->available;
  585.     }
  586.     /**
  587.      * @param bool $available
  588.      */
  589.     public function setAvailable(bool $available)
  590.     {
  591.         $this->available $available;
  592.     }
  593.     /**
  594.      * @return SupplierAdjudication
  595.      */
  596.     public function getSupplierAdjudication()
  597.     {
  598.         return $this->supplierAdjudication;
  599.     }
  600.     /**
  601.      * @param SupplierAdjudication $supplierAdjudication
  602.      */
  603.     public function setSupplierAdjudication(SupplierAdjudication $supplierAdjudication): void
  604.     {
  605.         $this->supplierAdjudication $supplierAdjudication;
  606.     }
  607.     public function getContracts()
  608.     {
  609.         return $this->contracts;
  610.     }
  611.     public function setContracts($contracts)
  612.     {
  613.         $this->contracts $contracts;
  614.     }
  615.     public function addContract(SupplierContract $contract)
  616.     {
  617.         if (!$this->contracts->contains($contract)) {
  618.             $this->contracts->add($contract);
  619.         }
  620.         $contract->setSupplier($this);
  621.     }
  622.     public function removeContract(SupplierContract $contract)
  623.     {
  624.         if ($this->contracts->contains($contract)) {
  625.             $this->contracts->removeElement($contract);
  626.         }
  627.     }
  628.     /**
  629.      * @return bool
  630.      */
  631.     public function hasValidContract() {
  632.         $now = new \DateTime('now');
  633.         foreach($this->getContracts() as $contract) {
  634.             if($contract->getFinishedAt() < $now) {
  635.                 return true;
  636.             }
  637.         }
  638.         return false;
  639.     }
  640.     /**
  641.      * @return mixed
  642.      */
  643.     public function getPaymentBank()
  644.     {
  645.         return $this->paymentBank;
  646.     }
  647.     /**
  648.      * @param mixed $paymentBank
  649.      */
  650.     public function setPaymentBank($paymentBank): void
  651.     {
  652.         $this->paymentBank $paymentBank;
  653.     }
  654.     /**
  655.      * @return mixed
  656.      */
  657.     public function getPaymentAccountNumber()
  658.     {
  659.         return $this->paymentAccountNumber;
  660.     }
  661.     /**
  662.      * @param mixed $paymentAccountNumber
  663.      */
  664.     public function setPaymentAccountNumber($paymentAccountNumber): void
  665.     {
  666.         $this->paymentAccountNumber $paymentAccountNumber;
  667.     }
  668.     /**
  669.      * @return mixed
  670.      */
  671.     public function getPaymentAccountType()
  672.     {
  673.         return $this->paymentAccountType;
  674.     }
  675.     /**
  676.      * @param mixed $paymentAccountType
  677.      */
  678.     public function setPaymentAccountType($paymentAccountType): void
  679.     {
  680.         $this->paymentAccountType $paymentAccountType;
  681.     }
  682.     /**
  683.      * @return mixed
  684.      */
  685.     public function getPaymentEmail()
  686.     {
  687.         return $this->paymentEmail;
  688.     }
  689.     /**
  690.      * @param mixed $paymentEmail
  691.      */
  692.     public function setPaymentEmail($paymentEmail): void
  693.     {
  694.         $this->paymentEmail $paymentEmail;
  695.     }
  696.     /**
  697.      * @return mixed
  698.      */
  699.     public function getSpecialSituation()
  700.     {
  701.         return $this->specialSituation;
  702.     }
  703.     /**
  704.      * @param mixed $specialSituation
  705.      */
  706.     public function setSpecialSituation($specialSituation): void
  707.     {
  708.         $this->specialSituation $specialSituation;
  709.     }
  710.     /**
  711.      * @return mixed
  712.      */
  713.     public function getUpdatedAt()
  714.     {
  715.         return $this->updatedAt;
  716.     }
  717.     /**
  718.      * @param mixed $updatedAt
  719.      */
  720.     public function setUpdatedAt($updatedAt): void
  721.     {
  722.         $this->updatedAt $updatedAt;
  723.     }
  724.     /**
  725.      * @return mixed
  726.      */
  727.     public function getUpdatedBy()
  728.     {
  729.         return $this->updatedBy;
  730.     }
  731.     /**
  732.      * @param mixed $updatedBy
  733.      */
  734.     public function setUpdatedBy($updatedBy): void
  735.     {
  736.         $this->updatedBy $updatedBy;
  737.     }
  738.     public function getDocuments()
  739.     {
  740.         return $this->documents;
  741.     }
  742.     public function getSupplierDocuments()
  743.     {
  744.         return $this->documents;
  745.     }
  746.     public function setDocuments($documents)
  747.     {
  748.         $this->documents $documents;
  749.     }
  750.     public function addDocument(SupplierDocument $document)
  751.     {
  752.         if (!$this->documents->contains($document)) {
  753.             $this->documents->add($document);
  754.         }
  755.         $document->setSupplier($this);
  756.     }
  757.     public function removeDocument(SupplierDocument $document)
  758.     {
  759.         if ($this->documents->contains($document)) {
  760.             $this->documents->removeElement($document);
  761.         }
  762.     }
  763.     public function getDocument()
  764.     {
  765.         return self::getDocuments()->first();
  766.     }
  767.     public function getFullName()
  768.     {
  769.         $name $this->getName();
  770.         $rut $this->getRut();
  771.         $fullName $name ' - ' $rut;
  772.         return $fullName;
  773.     }
  774.     /**
  775.      * @return string
  776.      */
  777.     public function getWomanCompanyDocument()
  778.     {
  779.         return $this->womanCompanyDocument;
  780.     }
  781.     /**
  782.      * @param string $womanCompanyDocument
  783.      */
  784.     public function setWomanCompanyDocument(?string $womanCompanyDocument)
  785.     {
  786.         $this->womanCompanyDocument $womanCompanyDocument;
  787.     }
  788.     /**
  789.      * @return File
  790.      */
  791.     public function getWomanCompanyDocumentFile()
  792.     {
  793.         return $this->womanCompanyDocumentFile;
  794.     }
  795.     /**
  796.      * @param File $womanCompanyDocumentFile
  797.      */
  798.     public function setWomanCompanyDocumentFile(?File $womanCompanyDocumentFile null)
  799.     {
  800.         $this->womanCompanyDocumentFile $womanCompanyDocumentFile;
  801.         if ($womanCompanyDocumentFile) {
  802.             $this->womanCompanyDocumentUpdatedAt = new \DateTime('now');
  803.         }
  804.     }
  805.     /**
  806.      * @return \DateTime
  807.      */
  808.     public function getWomanCompanyDocumentUpdatedAt()
  809.     {
  810.         return $this->womanCompanyDocumentUpdatedAt;
  811.     }
  812.     /**
  813.      * @param \DateTime $womanCompanyDocumentUpdatedAt
  814.      */
  815.     public function setWomanCompanyDocumentUpdatedAt(?\DateTime $womanCompanyDocumentUpdatedAt)
  816.     {
  817.         $this->womanCompanyDocumentUpdatedAt $womanCompanyDocumentUpdatedAt;
  818.     }
  819.     /**
  820.      * @return string
  821.      */
  822.     public function getLaborInclusionDocument()
  823.     {
  824.         return $this->laborInclusionDocument;
  825.     }
  826.     /**
  827.      * @param string $laborInclusionDocument
  828.      */
  829.     public function setLaborInclusionDocument(?string $laborInclusionDocument)
  830.     {
  831.         $this->laborInclusionDocument $laborInclusionDocument;
  832.     }
  833.     /**
  834.      * @return File
  835.      */
  836.     public function getLaborInclusionDocumentFile()
  837.     {
  838.         return $this->laborInclusionDocumentFile;
  839.     }
  840.     /**
  841.      * @param File $laborInclusionDocumentFile
  842.      */
  843.     public function setLaborInclusionDocumentFile(?File $laborInclusionDocumentFile null)
  844.     {
  845.         $this->laborInclusionDocumentFile $laborInclusionDocumentFile;
  846.         if ($laborInclusionDocumentFile) {
  847.             $this->laborInclusionDocumentUpdatedAt = new \DateTime('now');
  848.         }
  849.     }
  850.     /**
  851.      * @return \DateTime
  852.      */
  853.     public function getLaborInclusionDocumentUpdatedAt()
  854.     {
  855.         return $this->laborInclusionDocumentUpdatedAt;
  856.     }
  857.     /**
  858.      * @param \DateTime $laborInclusionDocumentUpdatedAt
  859.      */
  860.     public function setLaborInclusionDocumentUpdatedAt(?\DateTime $laborInclusionDocumentUpdatedAt)
  861.     {
  862.         $this->laborInclusionDocumentUpdatedAt $laborInclusionDocumentUpdatedAt;
  863.     }
  864.     /**
  865.      * @return string
  866.      */
  867.     public function getGenderEquityDocument()
  868.     {
  869.         return $this->genderEquityDocument;
  870.     }
  871.     /**
  872.      * @param string $genderEquityDocument
  873.      */
  874.     public function setGenderEquityDocument(?string $genderEquityDocument)
  875.     {
  876.         $this->genderEquityDocument $genderEquityDocument;
  877.     }
  878.     /**
  879.      * @return File
  880.      */
  881.     public function getGenderEquityDocumentFile()
  882.     {
  883.         return $this->genderEquityDocumentFile;
  884.     }
  885.     /**
  886.      * @param File $genderEquityDocumentFile
  887.      */
  888.     public function setGenderEquityDocumentFile(?File $genderEquityDocumentFile null)
  889.     {
  890.         $this->genderEquityDocumentFile $genderEquityDocumentFile;
  891.         if ($genderEquityDocumentFile) {
  892.             $this->genderEquityDocumentUpdatedAt = new \DateTime('now');
  893.         }
  894.     }
  895.     /**
  896.      * @return \DateTime
  897.      */
  898.     public function getGenderEquityDocumentUpdatedAt()
  899.     {
  900.         return $this->genderEquityDocumentUpdatedAt;
  901.     }
  902.     /**
  903.      * @param \DateTime $genderEquityDocumentUpdatedAt
  904.      */
  905.     public function setGenderEquityDocumentUpdatedAt(?\DateTime $genderEquityDocumentUpdatedAt)
  906.     {
  907.         $this->genderEquityDocumentUpdatedAt $genderEquityDocumentUpdatedAt;
  908.     }
  909.     /**
  910.      * @return string
  911.      */
  912.     public function getEnvironmentalPracticesDocument()
  913.     {
  914.         return $this->environmentalPracticesDocument;
  915.     }
  916.     /**
  917.      * @param string $environmentalPracticesDocument
  918.      */
  919.     public function setEnvironmentalPracticesDocument(?string $environmentalPracticesDocument)
  920.     {
  921.         $this->environmentalPracticesDocument $environmentalPracticesDocument;
  922.     }
  923.     /**
  924.      * @return File
  925.      */
  926.     public function getEnvironmentalPracticesDocumentFile()
  927.     {
  928.         return $this->environmentalPracticesDocumentFile;
  929.     }
  930.     /**
  931.      * @param File $environmentalPracticesDocumentFile
  932.      */
  933.     public function setEnvironmentalPracticesDocumentFile(?File $environmentalPracticesDocumentFile null)
  934.     {
  935.         $this->environmentalPracticesDocumentFile $environmentalPracticesDocumentFile;
  936.         if ($environmentalPracticesDocumentFile) {
  937.             $this->environmentalPracticesDocumentUpdatedAt = new \DateTime('now');
  938.         }
  939.     }
  940.     /**
  941.      * @return \DateTime
  942.      */
  943.     public function getEnvironmentalPracticesDocumentUpdatedAt()
  944.     {
  945.         return $this->environmentalPracticesDocumentUpdatedAt;
  946.     }
  947.     /**
  948.      * @param \DateTime $environmentalPracticesDocumentUpdatedAt
  949.      */
  950.     public function setEnvironmentalPracticesDocumentUpdatedAt(?\DateTime $environmentalPracticesDocumentUpdatedAt)
  951.     {
  952.         $this->environmentalPracticesDocumentUpdatedAt $environmentalPracticesDocumentUpdatedAt;
  953.     }
  954.     public function getHasNch3262(): bool
  955.     {
  956.         return $this->hasNch3262;
  957.     }
  958.     public function setHasNch3262(bool $hasNch3262): void
  959.     {
  960.         $this->hasNch3262 $hasNch3262;
  961.     }
  962.     public function getNch3262Document(): ?string
  963.     {
  964.         return $this->nch3262Document;
  965.     }
  966.     public function setNch3262Document(?string $nch3262Document): void
  967.     {
  968.         $this->nch3262Document $nch3262Document;
  969.     }
  970.     public function getNch3262DocumentFile(): ?File
  971.     {
  972.         return $this->nch3262DocumentFile;
  973.     }
  974.     public function setNch3262DocumentFile(?File $nch3262DocumentFile null): void
  975.     {
  976.         $this->nch3262DocumentFile $nch3262DocumentFile;
  977.         if ($nch3262DocumentFile) {
  978.             $this->nch3262DocumentUpdatedAt = new \DateTime('now');
  979.         }
  980.     }
  981.     public function getNch3262DocumentUpdatedAt(): ?\DateTime
  982.     {
  983.         return $this->nch3262DocumentUpdatedAt;
  984.     }
  985.     public function setNch3262DocumentUpdatedAt(?\DateTime $nch3262DocumentUpdatedAt): void
  986.     {
  987.         $this->nch3262DocumentUpdatedAt $nch3262DocumentUpdatedAt;
  988.     }
  989. }