src/Entity/User.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  9. use Symfony\Component\Security\Core\User\UserInterface;
  10. #[ORM\Entity(repositoryClassUserRepository::class)]
  11. #[UniqueEntity(fields: ['email'], message'There is already an account with this email')]
  12. class User implements UserInterfacePasswordAuthenticatedUserInterface
  13. {
  14.     public static function generatePassword($length 8)
  15.     {
  16.         $chars 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*()-_=+';
  17.         $password '';
  18.         for ($i 0$i $length$i++) {
  19.             $password .= $chars[rand(0strlen($chars) - 1)];
  20.         }
  21.         return $password;
  22.     }
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue]
  25.     #[ORM\Column]
  26.     private ?int $id null;
  27.     #[ORM\Column(length180uniquetrue)]
  28.     private ?string $email null;
  29.     #[ORM\Column]
  30.     private array $roles = [];
  31.     #[ORM\OneToMany(mappedBy'user'targetEntityCart::class, cascade: ['remove'], orphanRemovaltrue)]
  32.     private ?Collection $cart;
  33.     #[ORM\OneToMany(mappedBy'user'targetEntitySpecialCustomer::class, cascade: ['remove'], orphanRemovaltrue)]
  34.     private ?Collection $specialCustomerPourcent;
  35.     #[ORM\Column(name'specialCustomer'type'boolean'nullabletrue)]
  36.     private ?bool $specialCustomer;
  37.     #[ORM\OneToMany(mappedBy'user'targetEntityCustomerControl::class, cascade: ['remove'], orphanRemovaltrue)]
  38.     private ?Collection $customer;
  39.     #[ORM\OneToMany(mappedBy'customer'targetEntityCustomerControl::class, cascade: ['remove'], orphanRemovaltrue)]
  40.     private ?Collection $customerControl;
  41.     #[ORM\OneToMany(mappedBy'user'targetEntityBillings::class, cascade: ['remove'], orphanRemovaltrue)]
  42.     private ?Collection $billings;
  43.     #[ORM\OneToMany(mappedBy'user'targetEntityInvoices::class, cascade: ['remove'], orphanRemovaltrue)]
  44.     private ?Collection $invoice;
  45.     #[ORM\OneToMany(mappedBy'user'targetEntityCartFinished::class, cascade: ['remove'], orphanRemovaltrue)]
  46.     private ?Collection $cartFinished;
  47.     #[ORM\OneToMany(mappedBy'user'targetEntityAdditionalCompanyInformation::class, cascade: ['remove'], orphanRemovaltrue)]
  48.     private ?Collection $AdditionalCompanyInformation;
  49.     #[ORM\OneToMany(mappedBy'user'targetEntityJoker::class, cascade: ['remove'], orphanRemovaltrue)]
  50.     private ?Collection $joker;
  51.     #[ORM\OneToMany(mappedBy'user'targetEntityDeliveryAddress::class, cascade: ['remove'], orphanRemovaltrue)]
  52.     private ?Collection $deliveryAddress;
  53.     #[ORM\OneToMany(mappedBy'client'targetEntityTva::class, cascade: ['remove'], orphanRemovaltrue)]
  54.     private ?Collection $tva;
  55.     #[ORM\Column(name'generatePasswordRecovery'type'string'nullabletrue)]
  56.     private ?string $generatePasswordRecovery;
  57.     #[ORM\Column(name'resetToken'type'string'length100nullabletrue)]
  58.     private ?string $resetToken null;
  59.     #[ORM\Column(name'resetTokenExpiresAt'type'datetime'nullabletrue)]
  60.     private ?\DateTimeInterface $resetTokenExpiresAt null;
  61.     //    #[ORM\Column(name: 'typeOfProfessional', type: 'string', nullable: true)]
  62.     //    private ?string $typeOfProfessional;
  63.     #[ORM\Column(name'additionalPercentage'type'float'nullabletrue)]
  64.     private ?float $additionalPercentage 0.0;
  65.     #[ORM\Column(name'name'type'string'nullabletrue)]
  66.     private ?string $name;
  67.     #[ORM\Column(name'firstName'type'string'nullabletrue)]
  68.     private ?string $firstName;
  69.     #[ORM\Column(name'address'type'string'nullabletrue)]
  70.     private ?string $address;
  71.     #[ORM\Column(name'postal'type'string'nullabletrue)]
  72.     private ?string $postal;
  73.     #[ORM\Column(name'locality'type'string'nullabletrue)]
  74.     private ?string $locality;
  75.     #[ORM\Column(name'country'type'string'nullabletrue)]
  76.     private ?string $country;
  77.     #[ORM\Column(name'phoneNumber'type'string'nullabletrue)]
  78.     private ?string $phoneNumber;
  79.     #[ORM\Column(name'directPhone'type'string'nullabletrue)]
  80.     private ?string $directPhone;
  81.     #[ORM\Column(name'otherMail'type'string'nullabletrue)]
  82.     private ?string $otherMail;
  83.     #[ORM\Column(name'companyName'type'string'nullabletrue)]
  84.     private ?string $companyName;
  85.     #[ORM\Column(name'active'type'boolean'nullabletrue)]
  86.     private ?bool $active;
  87.     #[ORM\Column(name'gender'type'string'nullabletrue)]
  88.     private ?string $gender;
  89.     #[ORM\Column(name'userSupplementsPurchaseDecisionMaker'type'boolean'nullabletrue)]
  90.     private ?bool $userSupplementsPurchaseDecisionMaker;
  91.     /**
  92.      * @return string|null
  93.      */
  94.     public function getGeneratePasswordRecovery(): ?string
  95.     {
  96.         return $this->generatePasswordRecovery;
  97.     }
  98.     /**
  99.      * @param string|null $generatePasswordRecovery
  100.      */
  101.     public function setGeneratePasswordRecovery(?string $generatePasswordRecovery): void
  102.     {
  103.         $this->generatePasswordRecovery $generatePasswordRecovery;
  104.     }
  105.     /**
  106.      * @return Collection|null
  107.      */
  108.     public function getSpecialCustomerPourcent(): ?Collection
  109.     {
  110.         return $this->specialCustomerPourcent;
  111.     }
  112.     /**
  113.      * @param Collection|null $specialCustomerPourcent
  114.      */
  115.     public function setSpecialCustomerPourcent(?Collection $specialCustomerPourcent): void
  116.     {
  117.         $this->specialCustomerPourcent $specialCustomerPourcent;
  118.     }
  119.     /**
  120.      * @return bool|null
  121.      */
  122.     public function getSpecialCustomer(): ?bool
  123.     {
  124.         return $this->specialCustomer;
  125.     }
  126.     /**
  127.      * @param bool|null $specialCustomer
  128.      */
  129.     public function setSpecialCustomer(?bool $specialCustomer): void
  130.     {
  131.         $this->specialCustomer $specialCustomer;
  132.     }
  133.     /**
  134.      * @return Collection|null
  135.      */
  136.     public function getInvoice(): ?Collection
  137.     {
  138.         return $this->invoice;
  139.     }
  140.     /**
  141.      * @param Collection|null $invoice
  142.      */
  143.     public function setInvoice(?Collection $invoice): void
  144.     {
  145.         $this->invoice $invoice;
  146.     }
  147.     /**
  148.      * @return Collection|null
  149.      */
  150.     public function getCustomer(): ?Collection
  151.     {
  152.         return $this->customer;
  153.     }
  154.     /**
  155.      * @param Collection|null $customer
  156.      */
  157.     public function setCustomer(?Collection $customer): void
  158.     {
  159.         $this->customer $customer;
  160.     }
  161.     /**
  162.      * @return Collection|null
  163.      */
  164.     public function getCustomerControl(): ?Collection
  165.     {
  166.         return $this->customerControl;
  167.     }
  168.     /**
  169.      * @param Collection|null $customerControl
  170.      */
  171.     public function setCustomerControl(?Collection $customerControl): void
  172.     {
  173.         $this->customerControl $customerControl;
  174.     }
  175.     /**
  176.      * @return bool|null
  177.      */
  178.     public function getUserSupplementsPurchaseDecisionMaker(): ?bool
  179.     {
  180.         return $this->userSupplementsPurchaseDecisionMaker;
  181.     }
  182.     /**
  183.      * @param bool|null $userSupplementsPurchaseDecisionMaker
  184.      */
  185.     public function setUserSupplementsPurchaseDecisionMaker(?bool $userSupplementsPurchaseDecisionMaker): void
  186.     {
  187.         $this->userSupplementsPurchaseDecisionMaker $userSupplementsPurchaseDecisionMaker;
  188.     }
  189.     /**
  190.      * @return string|null
  191.      */
  192.     public function getGender(): ?string
  193.     {
  194.         return $this->gender;
  195.     }
  196.     /**
  197.      * @param string|null $gender
  198.      */
  199.     public function setGender(?string $gender): void
  200.     {
  201.         $this->gender $gender;
  202.     }
  203.     /**
  204.      * @return Collection|null
  205.      */
  206.     public function getBillings(): ?Collection
  207.     {
  208.         return $this->billings;
  209.     }
  210.     /**
  211.      * @param Collection|null $billings
  212.      */
  213.     public function setBillings(?Collection $billings): void
  214.     {
  215.         $this->billings $billings;
  216.     }
  217.     /**
  218.      * @return string|null
  219.      */
  220.     public function getDirectPhone(): ?string
  221.     {
  222.         return $this->directPhone;
  223.     }
  224.     /**
  225.      * @param string|null $directPhone
  226.      */
  227.     public function setDirectPhone(?string $directPhone): void
  228.     {
  229.         $this->directPhone $directPhone;
  230.     }
  231.     /**
  232.      * @return string|null
  233.      */
  234.     public function getLocality(): ?string
  235.     {
  236.         return $this->locality;
  237.     }
  238.     /**
  239.      * @param string|null $locality
  240.      */
  241.     public function setLocality(?string $locality): void
  242.     {
  243.         $this->locality $locality;
  244.     }
  245.     /**
  246.      * @return Collection|null
  247.      */
  248.     public function getCartFinished(): ?Collection
  249.     {
  250.         return $this->cartFinished;
  251.     }
  252.     /**
  253.      * @param Collection|null $cartFinished
  254.      */
  255.     public function setCartFinished(?Collection $cartFinished): void
  256.     {
  257.         $this->cartFinished $cartFinished;
  258.     }
  259.     /**
  260.      * @return float|null
  261.      */
  262.     public function getAdditionalPercentage(): ?float
  263.     {
  264.         return $this->additionalPercentage;
  265.     }
  266.     /**
  267.      * @param float|null $additionalPercentage
  268.      */
  269.     public function setAdditionalPercentage(?float $additionalPercentage): void
  270.     {
  271.         $this->additionalPercentage $additionalPercentage;
  272.     }
  273.     /**
  274.      * @return Collection|null
  275.      */
  276.     public function getAdditionalCompanyInformation(): ?Collection
  277.     {
  278.         return $this->AdditionalCompanyInformation;
  279.     }
  280.     /**
  281.      * @param Collection|null $AdditionalCompanyInformation
  282.      */
  283.     public function setAdditionalCompanyInformation(?Collection $AdditionalCompanyInformation): void
  284.     {
  285.         $this->AdditionalCompanyInformation $AdditionalCompanyInformation;
  286.     }
  287.     /**
  288.      * @return Collection|null
  289.      */
  290.     public function getJoker(): ?Collection
  291.     {
  292.         return $this->joker;
  293.     }
  294.     /**
  295.      * @param Collection|null $joker
  296.      */
  297.     public function setJoker(?Collection $joker): void
  298.     {
  299.         $this->joker $joker;
  300.     }
  301.     /**
  302.      * @return bool|null
  303.      */
  304.     public function getActive(): ?bool
  305.     {
  306.         return $this->active;
  307.     }
  308.     /**
  309.      * @param bool|null $active
  310.      */
  311.     public function setActive(?bool $active false): void
  312.     {
  313.         $this->active $active;
  314.     }
  315.     /**
  316.      * @return Collection|null
  317.      */
  318.     public function getDeliveryAddress(): ?Collection
  319.     {
  320.         return $this->deliveryAddress;
  321.     }
  322.     /**
  323.      * @param Collection|null $deliveryAddress
  324.      */
  325.     public function setDeliveryAddress(?Collection $deliveryAddress): void
  326.     {
  327.         $this->deliveryAddress $deliveryAddress;
  328.     }
  329.     /**
  330.      * @return Collection|null
  331.      */
  332.     public function getTva(): ?Collection
  333.     {
  334.         return $this->tva;
  335.     }
  336.     /**
  337.      * @param Collection|null $tva
  338.      */
  339.     public function setTva(?Collection $tva): void
  340.     {
  341.         $this->tva $tva;
  342.     }
  343.     /**
  344.      * @return string|null
  345.      */
  346.     public function getName(): ?string
  347.     {
  348.         return $this->name;
  349.     }
  350.     /**
  351.      * @param string|null $name
  352.      */
  353.     public function setName(?string $name): void
  354.     {
  355.         $this->name $name;
  356.     }
  357.     /**
  358.      * @return string|null
  359.      */
  360.     public function getFirstName(): ?string
  361.     {
  362.         return $this->firstName;
  363.     }
  364.     /**
  365.      * @param string|null $firstName
  366.      */
  367.     public function setFirstName(?string $firstName): void
  368.     {
  369.         $this->firstName $firstName;
  370.     }
  371.     /**
  372.      * @return string|null
  373.      */
  374.     public function getAddress(): ?string
  375.     {
  376.         return $this->address;
  377.     }
  378.     /**
  379.      * @param string|null $address
  380.      */
  381.     public function setAddress(?string $address): void
  382.     {
  383.         $this->address $address;
  384.     }
  385.     /**
  386.      * @return string|null
  387.      */
  388.     public function getCountry(): ?string
  389.     {
  390.         return $this->country;
  391.     }
  392.     /**
  393.      * @param string|null $country
  394.      */
  395.     public function setCountry(?string $country): void
  396.     {
  397.         $this->country $country;
  398.     }
  399.     /**
  400.      * @return string|null
  401.      */
  402.     public function getPostal(): ?string
  403.     {
  404.         return $this->postal;
  405.     }
  406.     /**
  407.      * @param string|null $postal
  408.      */
  409.     public function setPostal(?string $postal): void
  410.     {
  411.         $this->postal $postal;
  412.     }
  413.     /**
  414.      * @return string|null
  415.      */
  416.     public function getPhoneNumber(): ?string
  417.     {
  418.         return $this->phoneNumber;
  419.     }
  420.     /**
  421.      * @param string|null $phoneNumber
  422.      */
  423.     public function setPhoneNumber(?string $phoneNumber): void
  424.     {
  425.         $this->phoneNumber $phoneNumber;
  426.     }
  427.     /**
  428.      * @return string|null
  429.      */
  430.     public function getOtherMail(): ?string
  431.     {
  432.         return $this->otherMail;
  433.     }
  434.     /**
  435.      * @param string|null $otherMail
  436.      */
  437.     public function setOtherMail(?string $otherMail): void
  438.     {
  439.         $this->otherMail $otherMail;
  440.     }
  441.     /**
  442.      * @return string|null
  443.      */
  444.     public function getCompanyName(): ?string
  445.     {
  446.         return $this->companyName;
  447.     }
  448.     /**
  449.      * @param string|null $companyName
  450.      */
  451.     public function setCompanyName(?string $companyName): void
  452.     {
  453.         $this->companyName $companyName;
  454.     }
  455.     //    /**
  456.     //     * @return string|null
  457.     //     */
  458.     //    public function getTypeOfProfessional(): ?string
  459.     //    {
  460.     //        return $this->typeOfProfessional;
  461.     //    }
  462.     //
  463.     //    /**
  464.     //     * @param string|null $typeOfProfessional
  465.     //     */
  466.     //    public function setTypeOfProfessional(?string $typeOfProfessional): void
  467.     //    {
  468.     //        $this->typeOfProfessional = $typeOfProfessional;
  469.     //    }
  470.     /**
  471.      * @return Collection|null
  472.      */
  473.     public function getCart(): ?Collection
  474.     {
  475.         return $this->cart;
  476.     }
  477.     /**
  478.      * @param Collection|null $cart
  479.      */
  480.     public function setCart(?Collection $cart): void
  481.     {
  482.         $this->cart $cart;
  483.     }
  484.     /**
  485.      * @var string The hashed password
  486.      */
  487.     #[ORM\Column]
  488.     private ?string $password null;
  489.     /**
  490.      * @var string|null Temporary plain password for form input (not persisted)
  491.      */
  492.     private ?string $plainPassword null;
  493.     /**
  494.      * @var string|null Temporary plain password confirmation for form input (not persisted)
  495.      */
  496.     private ?string $plainPasswordConfirm null;
  497.     /** Champs transitoires pour le formulaire admin (non persistés en base sur User) */
  498.     private ?string $adminFormCompanyName null;
  499.     private ?string $adminFormMercatorId null;
  500.     private ?string $adminFormTva null;
  501.     private ?string $adminFormCompanyAddress null;
  502.     private ?string $adminFormCompanyPostal null;
  503.     private ?string $adminFormTownAddressCompany null;
  504.     private ?string $adminFormCompanyCountry null;
  505.     public function __construct()
  506.     {
  507.         $this->cart = new ArrayCollection();
  508.         $this->specialCustomerPourcent = new ArrayCollection();
  509.         $this->customer = new ArrayCollection();
  510.         $this->customerControl = new ArrayCollection();
  511.         $this->billings = new ArrayCollection();
  512.         $this->invoice = new ArrayCollection();
  513.         $this->cartFinished = new ArrayCollection();
  514.         $this->AdditionalCompanyInformation = new ArrayCollection();
  515.         $this->joker = new ArrayCollection();
  516.         $this->deliveryAddress = new ArrayCollection();
  517.         $this->tva = new ArrayCollection();
  518.     }
  519.     public function getId(): ?int
  520.     {
  521.         return $this->id;
  522.     }
  523.     public function getEmail(): ?string
  524.     {
  525.         return $this->email;
  526.     }
  527.     public function setEmail(string $email): self
  528.     {
  529.         $this->email $email;
  530.         return $this;
  531.     }
  532.     /**
  533.      * A visual identifier that represents this user.
  534.      *
  535.      * @see UserInterface
  536.      */
  537.     public function getUserIdentifier(): string
  538.     {
  539.         return (string) $this->email;
  540.     }
  541.     /**
  542.      * @see UserInterface
  543.      */
  544.     public function getRoles(): array
  545.     {
  546.         $roles $this->roles;
  547.         // guarantee every user at least has ROLE_USER
  548.         $roles[] = 'ROLE_USER';
  549.         return array_unique($roles);
  550.     }
  551.     public function setRoles(array $roles): self
  552.     {
  553.         $this->roles $roles;
  554.         return $this;
  555.     }
  556.     /**
  557.      * @see PasswordAuthenticatedUserInterface
  558.      */
  559.     public function getPassword(): string
  560.     {
  561.         return $this->password;
  562.     }
  563.     public function setPassword(string $password): self
  564.     {
  565.         $this->password $password;
  566.         return $this;
  567.     }
  568.     /**
  569.      * @see UserInterface
  570.      */
  571.     public function eraseCredentials()
  572.     {
  573.         // If you store any temporary, sensitive data on the user, clear it here
  574.         $this->plainPassword null;
  575.         $this->plainPasswordConfirm null;
  576.     }
  577.     public function getPlainPassword(): ?string
  578.     {
  579.         return $this->plainPassword;
  580.     }
  581.     public function setPlainPassword(?string $plainPassword): self
  582.     {
  583.         $this->plainPassword $plainPassword;
  584.         return $this;
  585.     }
  586.     public function getPlainPasswordConfirm(): ?string
  587.     {
  588.         return $this->plainPasswordConfirm;
  589.     }
  590.     public function setPlainPasswordConfirm(?string $plainPasswordConfirm): self
  591.     {
  592.         $this->plainPasswordConfirm $plainPasswordConfirm;
  593.         return $this;
  594.     }
  595.     public function getResetToken(): ?string
  596.     {
  597.         return $this->resetToken;
  598.     }
  599.     public function setResetToken(?string $resetToken): self
  600.     {
  601.         $this->resetToken $resetToken;
  602.         return $this;
  603.     }
  604.     public function getResetTokenExpiresAt(): ?\DateTimeInterface
  605.     {
  606.         return $this->resetTokenExpiresAt;
  607.     }
  608.     public function setResetTokenExpiresAt(?\DateTimeInterface $resetTokenExpiresAt): self
  609.     {
  610.         $this->resetTokenExpiresAt $resetTokenExpiresAt;
  611.         return $this;
  612.     }
  613.     public function __toString(): string
  614.     {
  615.         return $this->email ?? '';
  616.     }
  617.     public function getTvaNumbersAsString(): string
  618.     {
  619.         if (!isset($this->AdditionalCompanyInformation) || === $this->AdditionalCompanyInformation->count()) {
  620.             return '';
  621.         }
  622.         $tvas = [];
  623.         foreach ($this->AdditionalCompanyInformation as $info) {
  624.             $tvas[] = $info->getTva();
  625.         }
  626.         return implode(', '$tvas);
  627.     }
  628.     private function getFirstAdditionalCompanyInformation(): ?AdditionalCompanyInformation
  629.     {
  630.         if ($this->AdditionalCompanyInformation && $this->AdditionalCompanyInformation->count() > 0) {
  631.             $firstInfo $this->AdditionalCompanyInformation->first();
  632.             return $firstInfo ?: null;
  633.         }
  634.         return null;
  635.     }
  636.     public function getCompanyNameFromAdditionalInfo(): ?string
  637.     {
  638.         $info $this->getFirstAdditionalCompanyInformation();
  639.         return $info?->getCompanyName() ?? $this->adminFormCompanyName;
  640.     }
  641.     public function setCompanyNameFromAdditionalInfo(?string $companyName): void
  642.     {
  643.         $this->adminFormCompanyName $companyName;
  644.         $info $this->getFirstAdditionalCompanyInformation();
  645.         if ($info) {
  646.             $info->setCompanyName($companyName);
  647.         }
  648.     }
  649.     public function getMercatorIdFromAdditionalInfo(): ?string
  650.     {
  651.         $info $this->getFirstAdditionalCompanyInformation();
  652.         return $info?->getIdClientMercator() ?? $this->adminFormMercatorId;
  653.     }
  654.     public function setMercatorIdFromAdditionalInfo(?string $mercatorId): void
  655.     {
  656.         $this->adminFormMercatorId $mercatorId;
  657.         $info $this->getFirstAdditionalCompanyInformation();
  658.         if ($info) {
  659.             $info->setIdClientMercator($mercatorId);
  660.         }
  661.     }
  662.     public function getTvaFromAdditionalInfo(): ?string
  663.     {
  664.         $info $this->getFirstAdditionalCompanyInformation();
  665.         return $info?->getTva() ?? $this->adminFormTva;
  666.     }
  667.     public function setTvaFromAdditionalInfo(?string $tva): void
  668.     {
  669.         $this->adminFormTva $tva;
  670.         $info $this->getFirstAdditionalCompanyInformation();
  671.         if ($info) {
  672.             $info->setTva($tva);
  673.         }
  674.     }
  675.     public function getCompanyAddressFromAdditionalInfo(): ?string
  676.     {
  677.         $info $this->getFirstAdditionalCompanyInformation();
  678.         return $info?->getCompanyAddress() ?? $this->adminFormCompanyAddress;
  679.     }
  680.     public function setCompanyAddressFromAdditionalInfo(?string $address): void
  681.     {
  682.         $this->adminFormCompanyAddress $address;
  683.         $info $this->getFirstAdditionalCompanyInformation();
  684.         if ($info) {
  685.             $info->setCompanyAddress($address);
  686.         }
  687.     }
  688.     public function getCompanyPostalFromAdditionalInfo(): ?string
  689.     {
  690.         $info $this->getFirstAdditionalCompanyInformation();
  691.         return $info?->getCompanyPostal() ?? $this->adminFormCompanyPostal;
  692.     }
  693.     public function setCompanyPostalFromAdditionalInfo(?string $postal): void
  694.     {
  695.         $this->adminFormCompanyPostal $postal;
  696.         $info $this->getFirstAdditionalCompanyInformation();
  697.         if ($info) {
  698.             $info->setCompanyPostal($postal);
  699.         }
  700.     }
  701.     public function getTownAddressCompanyFromAdditionalInfo(): ?string
  702.     {
  703.         $info $this->getFirstAdditionalCompanyInformation();
  704.         return $info?->getTownAddressCompany() ?? $this->adminFormTownAddressCompany;
  705.     }
  706.     public function setTownAddressCompanyFromAdditionalInfo(?string $town): void
  707.     {
  708.         $this->adminFormTownAddressCompany $town;
  709.         $info $this->getFirstAdditionalCompanyInformation();
  710.         if ($info) {
  711.             $info->setTownAddressCompany($town);
  712.         }
  713.     }
  714.     public function getCompanyCountryFromAdditionalInfo(): ?string
  715.     {
  716.         $info $this->getFirstAdditionalCompanyInformation();
  717.         return $info?->getCompanyCountry() ?? $this->adminFormCompanyCountry;
  718.     }
  719.     public function setCompanyCountryFromAdditionalInfo(?string $country): void
  720.     {
  721.         $this->adminFormCompanyCountry $country;
  722.         $info $this->getFirstAdditionalCompanyInformation();
  723.         if ($info) {
  724.             $info->setCompanyCountry($country);
  725.         }
  726.     }
  727. }