src/Entity/User.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimestampableTrait;
  4. use App\Repository\UserRepository;
  5. use App\Validator\Constraints\CustomUniqueUser;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use JMS\Serializer\Annotation as Serializer;
  10. use SLLH\IsoCodesValidator\Constraints as IsoCodesAssert;
  11. use Symfony\Component\HttpFoundation\File\File;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  15. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  16. #[CustomUniqueUser(
  17.     fields: ['email', 'codeAurige'],
  18.     message: 'Vous êtes déjà inscrits',
  19.     groups: ['start_registration'],
  20.     errorPath: 'email',
  21.     ignoreIfEmpty: 'password'
  22. )]
  23. #[Vich\Uploadable]
  24. #[ORM\Entity(repositoryClass: UserRepository::class)]
  25. #[ORM\HasLifecycleCallbacks]
  26. #[Serializer\ExclusionPolicy('ALL')]
  27. #[ORM\Table(name: 'user')]
  28. #[ORM\Index(columns: ['compte_id'], name: 'compte_id')]
  29. class User implements UserInterface, \Serializable
  30. {
  31.     use TimestampableTrait;
  32.     #[ORM\Column(name: 'id', type: 'integer')]
  33.     #[ORM\Id]
  34.     #[ORM\GeneratedValue(strategy: 'AUTO')]
  35.     private int $id;
  36.     #[ORM\Column(name: 'civility', type: 'string', length: 10, nullable: true)]
  37.     #[Serializer\SerializedName('civility')]
  38.     #[Serializer\Expose]
  39.     private ?string $civility = null;
  40.     #[ORM\Column(name: 'lastname', type: 'string', length: 80, nullable: true)]
  41.     #[Assert\NotBlank(message: 'Le nom est obligatoire.', groups: ['registration'])]
  42.     #[Assert\Length(max: 80, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  43.     #[Assert\Regex(pattern: '/^[a-zùûüÿàâæçéèêëïîôœ \-]+$/i', message: 'Le nom est incorrect.', groups: ['registration'])]
  44.     #[Serializer\SerializedName('lastname')]
  45.     #[Serializer\Expose]
  46.     private ?string $lastname = null;
  47.     #[ORM\Column(name: 'firstname', type: 'string', length: 80, nullable: true)]
  48.     #[Assert\NotBlank(message: 'Le Prénom est obligatoire.', groups: ['registration'])]
  49.     #[Assert\Regex(pattern: '/^[a-zùûüÿàâæçéèêëïîôœ \-]+$/i', message: 'Le prénom est incorrect.', groups: ['registration'])]
  50.     #[Serializer\SerializedName('firstname')]
  51.     #[Serializer\Expose]
  52.     private ?string $firstname = null;
  53.     #[ORM\Column(name: 'company_name', type: 'string', length: 255, nullable: true)]
  54.     #[Serializer\SerializedName('corporate_name')]
  55.     #[Serializer\Expose]
  56.     protected ?string $companyName = null;
  57.     #[Assert\NotBlank(message: 'Le Code Aurige est obligatoire.', groups: ['start_registration', 'login'])]
  58.     #[ORM\Column(name: 'code_aurige', type: 'string', length: 11, unique: false, nullable: false)]
  59.     protected ?string $codeAurige = null;
  60.     #[ORM\Column(name: 'phone', type: 'string', length: 255, nullable: true)]
  61.     #[Serializer\SerializedName('phone')]
  62.     #[Serializer\Expose]
  63.     protected ?string $phone = null;
  64.     #[ORM\Column(name: 'email', type: 'string', length: 50, unique: true, nullable: false)]
  65.     #[Assert\NotBlank(message: "L'adresse email est obligatoire.", groups: ['start_registration', 'login'])]
  66.     #[Assert\Email(message: "L'email est incorrect.", mode: 'strict', groups: ['start_registration', 'login'])]
  67.     #[Assert\Length(max: 50, exactMessage: 'Le nombre de caractères est trop important.', groups: ['start_registration', 'login'])]
  68.     #[Serializer\SerializedName('email')]
  69.     #[Serializer\Expose]
  70.     private ?string $email = null;
  71.     #[ORM\Column(name: 'address', type: 'string', length: 38, nullable: true)]
  72.     #[Serializer\SerializedName('address_1')]
  73.     #[Serializer\Expose]
  74.     private ?string $address = null;
  75.     #[ORM\Column(name: 'address2', type: 'string', length: 38, nullable: true)]
  76.     #[Serializer\SerializedName('address_2')]
  77.     #[Serializer\Expose]
  78.     private ?string $address2 = null;
  79.     #[ORM\Column(name: 'address3', type: 'string', length: 38, nullable: true)]
  80.     #[Serializer\SerializedName('address_3')]
  81.     #[Serializer\Expose]
  82.     private ?string $address3 = null;
  83.     #[ORM\Column(name: 'address4', type: 'string', length: 38, nullable: true)]
  84.     #[Serializer\SerializedName('address_4')]
  85.     #[Serializer\Expose]
  86.     private ?string $address4 = null;
  87.     #[ORM\Column(name: 'postal_code', type: 'string', length: 5)]
  88.     #[Serializer\SerializedName('postal_code')]
  89.     #[Serializer\Expose]
  90.     private ?string $postalCode = null;
  91.     #[ORM\Column(name: 'city', type: 'string', length: 38)]
  92.     #[Serializer\SerializedName('city')]
  93.     #[Serializer\Expose]
  94.     private ?string $city = null;
  95.     #[ORM\Column(name: 'password', type: 'string', nullable: true)]
  96.     private ?string $password = null;
  97.     private array $roles = [];
  98.     #[ORM\Column(name: 'token', type: 'string', length: 32)]
  99.     private ?string $token = null;
  100.     #[ORM\Column(name: 'docapost_created_at', type: 'datetime', nullable: true)]
  101.     protected ?\DateTime $docapostCreatedAt = null;
  102.     #[ORM\Column(name: 'opt_in_modality', type: 'boolean', nullable: true)]
  103.     private ?bool $optInModality = null;
  104.     #[ORM\Column(name: 'opt_in_modality_2', type: 'boolean', nullable: true)]
  105.     private ?bool $optInModality2 = false;
  106.     #[ORM\Column(name: 'opt_in_modality_3', type: 'boolean', nullable: true)]
  107.     private ?bool $optInModality3 = false;
  108.     #[ORM\Column(type: 'integer', unique: true)]
  109.     private ?int $compteId = null;
  110.     #[ORM\OneToMany(mappedBy: 'User', targetEntity: Calculation::class)]
  111.     private Collection $calculations;
  112.     #[ORM\OneToOne(mappedBy: 'user', targetEntity: DocapostReturn::class, cascade: ['persist', 'remove'])]
  113.     private DocapostReturn $docapostReturn;
  114.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  115.     #[Assert\NotBlank(message: 'L’IBAN est obligatoire', groups: ['registration'])]
  116.     #[Assert\Iban(message: "L'IBAN n'est pas correct", groups: ['registration'])]
  117.     #[Serializer\SerializedName('iban')]
  118.     #[Serializer\Expose]
  119.     private ?string $iban = null;
  120.     #[ORM\Column(type: 'string', length: 11, nullable: true)]
  121.     #[Assert\NotBlank(message: 'Le BIC est obligatoire', groups: ['registration'])]
  122.     #[Assert\Bic(message: "Le format du BIC (Bank Identifier Code) n'est pas valide.", groups: ['registration'])]
  123.     #[Serializer\SerializedName('bic')]
  124.     #[Serializer\Expose]
  125.     private ?string $bic = null;
  126.     #[ORM\Column(type: 'datetime', nullable: true)]
  127.     private ?\DateTime $start_new_settings = null;
  128.     #[ORM\Column(type: 'boolean', nullable: true)]
  129.     #[Assert\IsTrue(message: 'Ce champ est obligatoire', groups: ['registration'])]
  130.     private ?bool $newOptInModality = null;
  131.     #[ORM\Column(type: 'boolean', nullable: true)]
  132.     #[Assert\IsTrue(message: 'Ce champ est obligatoire', groups: ['registration'])]
  133.     private ?bool $newOptInModality2 = null;
  134.     #[ORM\OneToMany(mappedBy: 'user', targetEntity: MonthlyCalculation::class, orphanRemoval: true)]
  135.     #[ORM\OrderBy(['year' => 'ASC', 'month' => 'ASC'])]
  136.     private Collection $monthlyCalculations;
  137.     /**
  138.      * @IsoCodesAssert\Siren(message="Cette valeur n'est pas un code SIREN valide",groups={"registration"})
  139.      */
  140.     #[ORM\Column(type: 'string', length: 9, nullable: true)]
  141.     #[Assert\NotBlank(message: 'N° de SIREN est obligatoire', groups: ['registration'])]
  142.     #[Serializer\SerializedName('siren')]
  143.     #[Serializer\Expose]
  144.     private ?string $SIREN = null;
  145.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  146.     #[Assert\NotBlank(message: 'Forme Juridique est obligatoire', groups: ['registration'])]
  147.     private ?string $formeJuridique = null;
  148.     #[ORM\Column(type: 'integer', nullable: true)]
  149.     #[Assert\NotBlank(message: 'Montant du capital social est obligatoire', groups: ['registration'])]
  150.     private ?int $capitalSocial = null;
  151.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  152.     #[Assert\NotBlank(message: 'N° RCS et Ville du Greffe est obligatoire', groups: ['registration'])]
  153.     private ?string $noRCS = null;
  154.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  155.     #[Assert\NotBlank(message: 'N° TVA obligatoire.', groups: ['registration'])]
  156.     private ?string $noTVA = null;
  157.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  158.     #[Assert\NotBlank(message: 'Dénomination sociale est obligatoire.', groups: ['registration'])]
  159.     private ?string $newCompanyName = null;
  160.     #[ORM\Column(type: 'string', length: 38, nullable: true)]
  161.     #[Assert\NotBlank(message: "L'adresse est obligatoire.", groups: ['registration'])]
  162.     #[Assert\Length(max: 38, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  163.     private ?string $newAddress = null;
  164.     #[ORM\Column(type: 'string', length: 38, nullable: true)]
  165.     #[Assert\Length(max: 38, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  166.     private ?string $newAddress2 = null;
  167.     #[ORM\Column(type: 'string', length: 38, nullable: true)]
  168.     #[Assert\Length(max: 38, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  169.     private ?string $newAddress3 = null;
  170.     #[ORM\Column(type: 'string', length: 38, nullable: true)]
  171.     #[Assert\Length(max: 38, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  172.     private ?string $newAddress4 = null;
  173.     #[ORM\Column(type: 'string', length: 5, nullable: true)]
  174.     #[Assert\NotBlank(message: 'Le code postal est obligatoire.', groups: ['registration'])]
  175.     #[Assert\Regex(pattern: '/^[0-9]+[a-z ]*$/i', message: 'Le code postal ne semble pas être au bon format.', groups: ['registration'])]
  176.     #[Assert\Length(min: 5, max: 5, exactMessage: 'Le code postal doit être à 5 chiffres.', groups: ['registration'])]
  177.     private ?string $newPostalCode = null;
  178.     #[ORM\Column(type: 'string', length: 38, nullable: true)]
  179.     #[Assert\NotBlank(message: 'La ville est obligatoire.', groups: ['registration'])]
  180.     #[Assert\Length(max: 38, exactMessage: 'Le nombre de caractères est trop important.', groups: ['registration'])]
  181.     #[Assert\Regex(pattern: "/^[a-zùûüÿàâæçéèêëïîôœ '\\-]+\$/i", message: 'La ville est incorrecte.', groups: ['registration'])]
  182.     private ?string $newCity = null;
  183.     #[ORM\Embedded(class: EmbeddedFile::class)]
  184.     private EmbeddedFile $invoice;
  185.     #[Vich\UploadableField(mapping: 'participation_invoice', fileNameProperty: 'invoice.name', size: 'invoice.size', mimeType: 'invoice.mimeType', originalName: 'invoice.originalName', dimensions: 'invoice.dimensions')]
  186.     private ?File $invoiceFile = null;
  187.     #[ORM\Column(type: 'string', length: 255, nullable: true)]
  188.     #[Assert\NotBlank(message: 'La fonction est obligatoire.', groups: ['registration'])]
  189.     private ?string $position = null;
  190.     public function __construct()
  191.     {
  192.         $this->calculations = new ArrayCollection();
  193.         $this->monthlyCalculations = new ArrayCollection();
  194.         $this->invoice = new EmbeddedFile();
  195.     }
  196.     /**
  197.      * @throws \Exception
  198.      */
  199.     #[ORM\PrePersist]
  200.     public function prePersist(): void
  201.     {
  202.         $this->token = md5(random_bytes(20));
  203.     }
  204.     #[ORM\PrePersist]
  205.     #[ORM\PreUpdate]
  206.     public function updatedTimestamps(): void
  207.     {
  208.         $dateTimeNow = new \DateTime('now');
  209.         $this->setUpdatedAt($dateTimeNow);
  210.         if (null === $this->getCreatedAt()) {
  211.             $this->setCreatedAt($dateTimeNow);
  212.         }
  213.     }
  214.     public function getId(): int
  215.     {
  216.         return $this->id;
  217.     }
  218.     public function setCivility(?string $civility): static
  219.     {
  220.         $this->civility = $civility;
  221.         return $this;
  222.     }
  223.     public function getCivility(): int
  224.     {
  225.         return (int) $this->civility;
  226.     }
  227.     public function setLastname(?string $lastname): static
  228.     {
  229.         $this->lastname = $lastname;
  230.         return $this;
  231.     }
  232.     public function getLastname(): ?string
  233.     {
  234.         return $this->lastname;
  235.     }
  236.     public function getFullName(): string
  237.     {
  238.         return $this->firstname.' '.$this->lastname;
  239.     }
  240.     public function getUrlPassword(): ?string
  241.     {
  242.         return $this->token;
  243.     }
  244.     public function getStringCivility(): string
  245.     {
  246.         if (1 === $this->getCivility()) {
  247.             return 'Mr';
  248.         } else {
  249.             return 'Mme';
  250.         }
  251.     }
  252.     public function setFirstname(?string $firstname): static
  253.     {
  254.         $this->firstname = $firstname;
  255.         return $this;
  256.     }
  257.     public function getFirstname(): ?string
  258.     {
  259.         return $this->firstname;
  260.     }
  261.     public function setEmail(?string $email): static
  262.     {
  263.         $this->email = $email;
  264.         return $this;
  265.     }
  266.     public function getEmail(): ?string
  267.     {
  268.         return $this->email;
  269.     }
  270.     public function setPostalCode(?string $postalCode): static
  271.     {
  272.         $this->postalCode = $postalCode;
  273.         return $this;
  274.     }
  275.     public function getPostalCode(): ?string
  276.     {
  277.         return $this->postalCode;
  278.     }
  279.     public function getAddress(): ?string
  280.     {
  281.         return $this->address;
  282.     }
  283.     public function setAddress(?string $address): static
  284.     {
  285.         $this->address = $address;
  286.         return $this;
  287.     }
  288.     public function getAddress2(): ?string
  289.     {
  290.         return $this->address2;
  291.     }
  292.     public function setAddress2(?string $address2): static
  293.     {
  294.         $this->address2 = $address2;
  295.         return $this;
  296.     }
  297.     public function setToken(string $token): static
  298.     {
  299.         $this->token = $token;
  300.         return $this;
  301.     }
  302.     public function getToken(): ?string
  303.     {
  304.         return $this->token;
  305.     }
  306.     public function getRoles(): array
  307.     {
  308.         return ['ROLE_USER'];
  309.     }
  310.     public function getPassword(): ?string
  311.     {
  312.         return $this->password;
  313.     }
  314.     /**
  315.      * Returns the salt that was originally used to encode the password.
  316.      *
  317.      * This can return null if the password was not encoded using a salt.
  318.      */
  319.     public function getSalt(): ?string
  320.     {
  321.         return null;
  322.     }
  323.     /**
  324.      * Returns the username used to authenticate the user.
  325.      */
  326.     public function getUsername(): string
  327.     {
  328.         return $this->getUserIdentifier();
  329.     }
  330.     /**
  331.      * Removes sensitive data from the user.
  332.      *
  333.      * This is important if, at any given point, sensitive information like
  334.      * the plain-text password is stored on this object.
  335.      */
  336.     public function eraseCredentials(): void
  337.     {
  338.         // TODO: Implement eraseCredentials() method.
  339.     }
  340.     public function setPassword(?string $password): static
  341.     {
  342.         $this->password = $password;
  343.         return $this;
  344.     }
  345.     public function getCompanyName(): ?string
  346.     {
  347.         return $this->companyName;
  348.     }
  349.     public function setCompanyName(string $companyName): void
  350.     {
  351.         $this->companyName = $companyName;
  352.     }
  353.     public function getCodeAurige(): ?string
  354.     {
  355.         return $this->codeAurige;
  356.     }
  357.     public function setCodeAurige(?string $codeAurige): static
  358.     {
  359.         $this->codeAurige = $codeAurige;
  360.         return $this;
  361.     }
  362.     public function getPhone(): ?string
  363.     {
  364.         return $this->phone;
  365.     }
  366.     public function setPhone(?string $phone): static
  367.     {
  368.         $this->phone = $phone;
  369.         return $this;
  370.     }
  371.     public function getAddress3(): ?string
  372.     {
  373.         return $this->address3;
  374.     }
  375.     public function setAddress3(?string $address3): static
  376.     {
  377.         $this->address3 = $address3;
  378.         return $this;
  379.     }
  380.     public function getAddress4(): ?string
  381.     {
  382.         return $this->address4;
  383.     }
  384.     public function setAddress4(?string $address4): static
  385.     {
  386.         $this->address4 = $address4;
  387.         return $this;
  388.     }
  389.     public function getCity(): ?string
  390.     {
  391.         return $this->city;
  392.     }
  393.     public function setCity(string $city): static
  394.     {
  395.         $this->city = $city;
  396.         return $this;
  397.     }
  398.     public function getDocapostCreatedAt(): ?\DateTime
  399.     {
  400.         return $this->docapostCreatedAt;
  401.     }
  402.     public function setDocapostCreatedAt(\DateTime $docapostCreatedAt): static
  403.     {
  404.         $this->docapostCreatedAt = $docapostCreatedAt;
  405.         return $this;
  406.     }
  407.     public function getOptInModality(): ?bool
  408.     {
  409.         return $this->optInModality;
  410.     }
  411.     public function setOptInModality(bool $optInModality): static
  412.     {
  413.         $this->optInModality = $optInModality;
  414.         return $this;
  415.     }
  416.     public function isOptInModality2(): ?bool
  417.     {
  418.         return $this->optInModality2;
  419.     }
  420.     public function setOptInModality2(?bool $optInModality2): static
  421.     {
  422.         $this->optInModality2 = $optInModality2;
  423.         return $this;
  424.     }
  425.     public function isOptInModality3(): ?bool
  426.     {
  427.         return $this->optInModality3;
  428.     }
  429.     public function setOptInModality3(?bool $optInModality3): static
  430.     {
  431.         $this->optInModality3 = $optInModality3;
  432.         return $this;
  433.     }
  434.     public function getWordingCivility(): string
  435.     {
  436.         if ('1' === $this->civility) {
  437.             return 'M';
  438.         }
  439.         return 'Mme';
  440.     }
  441.     public function getCompteId(): ?int
  442.     {
  443.         return $this->compteId;
  444.     }
  445.     public function setCompteId(?int $compteId): self
  446.     {
  447.         $this->compteId = $compteId;
  448.         return $this;
  449.     }
  450.     public function getCalculations(): Collection
  451.     {
  452.         return $this->calculations;
  453.     }
  454.     public function addCalculation(Calculation $calculation): self
  455.     {
  456.         if (!$this->calculations->contains($calculation)) {
  457.             $this->calculations[] = $calculation;
  458.             $calculation->setUser($this);
  459.         }
  460.         return $this;
  461.     }
  462.     public function removeCalculation(Calculation $calculation): self
  463.     {
  464.         if ($this->calculations->removeElement($calculation)) {
  465.             // set the owning side to null (unless already changed)
  466.             if ($calculation->getUser() === $this) {
  467.                 $calculation->setUser(null);
  468.             }
  469.         }
  470.         return $this;
  471.     }
  472.     public function getDocapostReturn(): ?DocapostReturn
  473.     {
  474.         return $this->docapostReturn;
  475.     }
  476.     public function setDocapostReturn(DocapostReturn $docapostReturn): self
  477.     {
  478.         $this->docapostReturn = $docapostReturn;
  479.         // set the owning side of the relation if necessary
  480.         if ($docapostReturn->getUser() !== $this) {
  481.             $docapostReturn->setUser($this);
  482.         }
  483.         return $this;
  484.     }
  485.     public function getIban(): ?string
  486.     {
  487.         return $this->iban;
  488.     }
  489.     public function setIban(?string $iban): self
  490.     {
  491.         $this->iban = $iban;
  492.         return $this;
  493.     }
  494.     public function getBic(): ?string
  495.     {
  496.         return $this->bic;
  497.     }
  498.     public function setBic(?string $bic): self
  499.     {
  500.         $this->bic = $bic;
  501.         return $this;
  502.     }
  503.     public function getStartNewSettings(): ?\DateTime
  504.     {
  505.         return $this->start_new_settings;
  506.     }
  507.     public function setStartNewSettings(?\DateTime $start_new_settings): self
  508.     {
  509.         $this->start_new_settings = $start_new_settings;
  510.         return $this;
  511.     }
  512.     public function getNewOptInModality(): ?bool
  513.     {
  514.         return $this->newOptInModality;
  515.     }
  516.     public function setNewOptInModality(?bool $newOptInModality): self
  517.     {
  518.         $this->newOptInModality = $newOptInModality;
  519.         return $this;
  520.     }
  521.     public function getNewOptInModality2(): ?bool
  522.     {
  523.         return $this->newOptInModality2;
  524.     }
  525.     public function setNewOptInModality2(?bool $newOptInModality2): self
  526.     {
  527.         $this->newOptInModality2 = $newOptInModality2;
  528.         return $this;
  529.     }
  530.     public function getMonthlyCalculations(): Collection
  531.     {
  532.         return $this->monthlyCalculations;
  533.     }
  534.     public function addMonthlyCalculation(MonthlyCalculation $monthlyCalculation): self
  535.     {
  536.         if (!$this->monthlyCalculations->contains($monthlyCalculation)) {
  537.             $this->monthlyCalculations[] = $monthlyCalculation;
  538.             $monthlyCalculation->setUser($this);
  539.         }
  540.         return $this;
  541.     }
  542.     public function removeMonthlyCalculation(MonthlyCalculation $monthlyCalculation): self
  543.     {
  544.         if ($this->monthlyCalculations->removeElement($monthlyCalculation)) {
  545.             // set the owning side to null (unless already changed)
  546.             if ($monthlyCalculation->getUser() === $this) {
  547.                 $monthlyCalculation->setUser(null);
  548.             }
  549.         }
  550.         return $this;
  551.     }
  552.     public function getSIREN(): ?string
  553.     {
  554.         return $this->SIREN;
  555.     }
  556.     public function setSIREN(?string $SIREN): self
  557.     {
  558.         $this->SIREN = $SIREN;
  559.         return $this;
  560.     }
  561.     public function getFormeJuridique(): ?string
  562.     {
  563.         return $this->formeJuridique;
  564.     }
  565.     public function setFormeJuridique(?string $formeJuridique): self
  566.     {
  567.         $this->formeJuridique = $formeJuridique;
  568.         return $this;
  569.     }
  570.     public function getCapitalSocial(): ?int
  571.     {
  572.         return $this->capitalSocial;
  573.     }
  574.     public function setCapitalSocial(?int $capitalSocial): self
  575.     {
  576.         $this->capitalSocial = $capitalSocial;
  577.         return $this;
  578.     }
  579.     public function getNoRCS(): ?string
  580.     {
  581.         return $this->noRCS;
  582.     }
  583.     public function setNoRCS(?string $noRCS): self
  584.     {
  585.         $this->noRCS = $noRCS;
  586.         return $this;
  587.     }
  588.     public function getNoTVA(): ?string
  589.     {
  590.         return $this->noTVA;
  591.     }
  592.     public function setNoTVA(?string $noTVA): self
  593.     {
  594.         $this->noTVA = $noTVA;
  595.         return $this;
  596.     }
  597.     public function getNewCompanyName(): ?string
  598.     {
  599.         return $this->newCompanyName;
  600.     }
  601.     public function setNewCompanyName(?string $newCompanyName): self
  602.     {
  603.         $this->newCompanyName = $newCompanyName;
  604.         return $this;
  605.     }
  606.     public function getNewAddress(): ?string
  607.     {
  608.         return $this->newAddress;
  609.     }
  610.     public function setNewAddress(?string $newAddress): self
  611.     {
  612.         $this->newAddress = $newAddress;
  613.         return $this;
  614.     }
  615.     public function getNewAddress2(): ?string
  616.     {
  617.         return $this->newAddress2;
  618.     }
  619.     public function setNewAddress2(?string $newAddress2): self
  620.     {
  621.         $this->newAddress2 = $newAddress2;
  622.         return $this;
  623.     }
  624.     public function getNewAddress3(): ?string
  625.     {
  626.         return $this->newAddress3;
  627.     }
  628.     public function setNewAddress3(?string $newAddress3): self
  629.     {
  630.         $this->newAddress3 = $newAddress3;
  631.         return $this;
  632.     }
  633.     public function getNewAddress4(): ?string
  634.     {
  635.         return $this->newAddress4;
  636.     }
  637.     public function setNewAddress4(?string $newAddress4): self
  638.     {
  639.         $this->newAddress4 = $newAddress4;
  640.         return $this;
  641.     }
  642.     public function getNewPostalCode(): ?string
  643.     {
  644.         return $this->newPostalCode;
  645.     }
  646.     public function setNewPostalCode(?string $newPostalCode): self
  647.     {
  648.         $this->newPostalCode = $newPostalCode;
  649.         return $this;
  650.     }
  651.     public function getNewCity(): ?string
  652.     {
  653.         return $this->newCity;
  654.     }
  655.     public function setNewCity(?string $newCity): self
  656.     {
  657.         $this->newCity = $newCity;
  658.         return $this;
  659.     }
  660.     public function setInvoice(EmbeddedFile $invoice): self
  661.     {
  662.         $this->invoice = $invoice;
  663.         return $this;
  664.     }
  665.     public function getInvoice(): EmbeddedFile
  666.     {
  667.         return $this->invoice;
  668.     }
  669.     public function setInvoiceFile(?File $invoice = null): static
  670.     {
  671.         $this->invoiceFile = $invoice;
  672.         if (null !== $invoice) {
  673.             $this->updatedAt = new \DateTimeImmutable();
  674.         }
  675.         return $this;
  676.     }
  677.     public function getInvoiceFile(): ?File
  678.     {
  679.         return $this->invoiceFile;
  680.     }
  681.     public function serialize(): ?string
  682.     {
  683.         return serialize([$this->id, $this->email, $this->password]);
  684.     }
  685.     public function unserialize($data): void
  686.     {
  687.         [$this->id, $this->email, $this->password] = unserialize($data);
  688.     }
  689.     public function getPosition(): ?string
  690.     {
  691.         return $this->position;
  692.     }
  693.     public function setPosition(?string $position): self
  694.     {
  695.         $this->position = $position;
  696.         return $this;
  697.     }
  698.     public function getUserIdentifier(): string
  699.     {
  700.         return (string) $this->email;
  701.     }
  702. }