src/Entity/User.php line 40

Open in your IDE?
  1. <?php
  2.     namespace App\Entity;
  3.     use App\Factory\UserExtensionFactory;
  4.     use App\Repository\UserRepository;
  5.     use App\Services\Common\Point\UserPointService;
  6.     use App\Traits\DateTrait;
  7.     use App\Traits\UserExtensionTrait;
  8.     use App\Validator\NotInPasswordHistory;
  9.     use DateTime;
  10.     use DateTimeInterface;
  11.     use Doctrine\Common\Collections\ArrayCollection;
  12.     use Doctrine\Common\Collections\Collection;
  13.     use Doctrine\ORM\Mapping as ORM;
  14.     use Exception;
  15.     use JMS\Serializer\Annotation as Serializer;
  16.     use JMS\Serializer\Annotation\Expose;
  17.     use JMS\Serializer\Annotation\Groups;
  18.     use JMS\Serializer\Annotation\SerializedName;
  19.     use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  20.     use Symfony\Component\HttpFoundation\File\File;
  21.     use Symfony\Component\HttpFoundation\File\UploadedFile;
  22.     use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  23.     use Symfony\Component\Security\Core\User\UserInterface;
  24.     use Symfony\Component\Validator\Constraints as Assert;
  25.     use Vich\UploaderBundle\Mapping\Annotation as Vich;
  26.     /**
  27.      * @ORM\Table(indexes={@ORM\Index(name="sapAccount", columns={"sapAccount"})})
  28.      * @ORM\Entity(repositoryClass=UserRepository::class)
  29.      * @ORM\Table(name="`user`")
  30.      * @UniqueEntity("email")
  31.      * @ORM\HasLifecycleCallbacks()
  32.      *
  33.      * @Vich\Uploadable
  34.      *
  35.      * @Serializer\ExclusionPolicy("ALL")
  36.      */
  37.     class User implements UserInterfacePasswordAuthenticatedUserInterface
  38.     {
  39.         // TODO Check à quoi sert cette constante
  40.         public const SUPER_ADMINISTRATEUR 1;
  41.         use UserExtensionTrait;
  42.         /**
  43.          * @ORM\Id
  44.          * @ORM\GeneratedValue
  45.          * @ORM\Column(type="integer")
  46.          *
  47.          * @Expose()
  48.          * @Groups({
  49.          *     "default",
  50.          *     "user:id",
  51.          *     "user:list","user:item", "sale_order:item", "sale_order:post", "cdp", "user", "user_citroentf",
  52.          *     "export_user_citroentf_datatable",
  53.          *     "export_agency_manager_commercial_datatable",
  54.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  55.          *     "export_installer_datatable",
  56.          *     "sale_order", "purchase", "get:read","post:read", "export_user_datatable",
  57.          *     "export_commercial_datatable",
  58.          *     "regate-list", "point_of_sale", "parameter", "export_request_registration_datatable"
  59.          * })
  60.          */
  61.         private ?int $id NULL;
  62.         /**
  63.          * @ORM\Column(type="string", length=130, unique=true)
  64.          * @Assert\NotBlank()
  65.          * @Assert\Email(
  66.          *     message = "The email '{{ value }}' is not a valid email."
  67.          * )
  68.          *
  69.          * @Expose()
  70.          * @Groups({
  71.          *     "default",
  72.          *     "user:email",
  73.          *     "user:list", "user:item", "user:post", "sale_order:item", "cdp", "user","email", "user_citroentf",
  74.          *     "export_user_citroentf_datatable",
  75.          *     "export_purchase_declaration_datatable", "export_agency_manager_commercial_datatable",
  76.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  77.          *     "export_commercial_datatable",
  78.          *     "export_installer_datatable","get:read", "export_order_datatable", "purchase", "export_user_datatable",
  79.          *     "user_bussiness_result", "sale_order","export_request_registration_datatable", "request_registration",
  80.          *     "univers", "saleordervalidation",
  81.          *     "parameter"
  82.          * })
  83.          */
  84.         private $email;
  85.         /**
  86.          * @ORM\Column(type="array")
  87.          *
  88.          * @Expose()
  89.          * @Groups({
  90.          *     "user:roles",
  91.          *     "roles",
  92.          *     "cdp", "user", "user_citroentf","get:read", "export_user_citroentf_datatable", "export_user_datatable"
  93.          * })
  94.          */
  95.         private $roles = [];
  96.         /**
  97.          * @ORM\Column(type="string")
  98.          */
  99.         private $password;
  100.         /**
  101.          * @ORM\Column(type="string", length=50, nullable=true)
  102.          *
  103.          * @Expose()
  104.          * @Groups({
  105.          *     "default",
  106.          *     "user:first_name",
  107.          *     "user:list", "user:item", "user:post", "cdp", "user","email", "user_citroentf",
  108.          *     "export_order_datatable", "export_user_citroentf_datatable",
  109.          *     "user_bussiness_result", "export_purchase_declaration_datatable",
  110.          *     "export_agency_manager_commercial_datatable",
  111.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  112.          *     "export_commercial_datatable",
  113.          *     "purchase", "sale_order","get:read", "export_user_datatable", "export_installer_datatable",
  114.          *     "request_registration","customProductOrder:list", "parameter", "export_request_registration_datatable"
  115.          * })
  116.          */
  117.         private $firstName;
  118.         /**
  119.          * @ORM\Column(type="string", length=50, nullable=true)
  120.          *
  121.          * @Expose()
  122.          * @Groups({
  123.          *     "user:last_name",
  124.          *     "default",
  125.          *     "user:list", "user:item", "user:post", "cdp",  "user","email", "user_citroentf",
  126.          *     "export_order_datatable",
  127.          *     "export_user_citroentf_datatable",
  128.          *     "user_bussiness_result", "export_purchase_declaration_datatable",
  129.          *     "export_agency_manager_commercial_datatable",
  130.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  131.          *     "export_commercial_datatable",
  132.          *     "purchase", "sale_order","get:read", "export_user_datatable", "export_installer_datatable",
  133.          *     "request_registration","export_request_registration_datatable", "customProductOrder:list", "parameter"
  134.          * })
  135.          */
  136.         private $lastName;
  137.         /**
  138.          * Numéro téléphone portable
  139.          *
  140.          * @ORM\Column(type="string", length=20, nullable=true)
  141.          *
  142.          * @Expose()
  143.          * @Groups({
  144.          *     "user:mobile",
  145.          *     "commercial:mobile",
  146.          *     "user:item", "user:post", "user", "export_user_citroentf_datatable",
  147.          *     "export_purchase_declaration_datatable",
  148.          *                       "export_agency_manager_commercial_datatable",
  149.          *                  "export_agency_manager_datatable", "export_commercial_installer_datatable",
  150.          *                  "export_commercial_datatable", "export_user_datatable",
  151.          *                  "export_installer_datatable"})
  152.          */
  153.         private $mobile;
  154.         /**
  155.          * Numéro téléphone fix
  156.          * @ORM\Column(type="string", length=20, nullable=true)
  157.          *
  158.          * @Expose()
  159.          * @Groups({
  160.          *     "user:phone",
  161.          *     "user:item", "user:post", "user", "export_user_citroentf_datatable", "export_order_datatable",
  162.          *     "export_purchase_declaration_datatable",
  163.          *                  "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  164.          *                  "export_commercial_installer_datatable",
  165.          *                  "export_commercial_datatable","get:read", "export_user_datatable",
  166.          *                  "export_installer_datatable"})
  167.          */
  168.         private $phone;
  169.         /**
  170.          * @ORM\Column(type="datetime", nullable=true)
  171.          *
  172.          * @Expose()
  173.          * @Groups({"welcome_email","user", "user_citroentf"})
  174.          */
  175.         private $welcomeEmail;
  176.         /**
  177.          * @deprecated Utiliser la fonction getAvailablePointOfUser de PointService
  178.          * @ORM\Column(type="integer", options={"default": 0})
  179.          */
  180.         private $availablePoint 0;
  181.         /**
  182.          * @deprecated
  183.          * @ORM\Column(type="integer", options={"default": 0})
  184.          */
  185.         private $potentialPoint 0;
  186.         /**
  187.          * On passe par un userExtension maintenant
  188.          *
  189.          * @deprecated
  190.          * @ORM\Column(type="string", length=10, nullable=true)
  191.          */
  192.         private $locale;
  193.         /**
  194.          * Code du pays
  195.          *
  196.          * @ORM\Column(type="string", length=255, nullable=true)
  197.          *
  198.          * @Expose()
  199.          * @Groups({
  200.          *     "country",
  201.          *     "user:item", "user:post", "export_user_datatable", "export_user_citroentf_datatable",
  202.          *     "export_agency_manager_commercial_datatable",
  203.          *                                   "export_agency_manager_datatable", "export_commercial_datatable"})
  204.          */
  205.         private $country;
  206.         /**
  207.          * @ORM\Column(type="string", length=255, nullable=true)
  208.          *
  209.          * @Expose()
  210.          * @Groups({
  211.          *     "job",
  212.          *     "user:job",
  213.          *     "user","get:read", "export_user_datatable", "univers", "parameter"})
  214.          */
  215.         private $job;
  216.         /**
  217.          * Société
  218.          *
  219.          * @ORM\Column(type="string", length=255, nullable=true)
  220.          *
  221.          * @Expose()
  222.          * @Groups({
  223.          *     "user:company",
  224.          *     "default",
  225.          *     "user:item", "user:post", "user","email", "export_purchase_declaration_datatable",
  226.          *     "export_order_datatable",
  227.          *     "export_agency_manager_commercial_datatable",
  228.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  229.          *     "export_commercial_datatable",
  230.          *     "export_installer_datatable", "purchase","get:read","post:read", "export_user_datatable"
  231.          * })
  232.          */
  233.         private ?string $company NULL;
  234.         /**
  235.          * Numéro de Siret
  236.          *
  237.          * @ORM\Column(type="string", length=255, nullable=true)
  238.          *
  239.          * @Expose()
  240.          * @Groups({
  241.          *     "company_siret",
  242.          *     "export_order_datatable",
  243.          *     "export_purchase_declaration_datatable",
  244.          *     "export_installer_datatable",
  245.          *     "user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  246.          */
  247.         private ?string $companySiret NULL;
  248.         /**
  249.          * Forme juridique
  250.          *
  251.          * @ORM\Column(type="string", length=128, nullable=true)
  252.          *
  253.          * @Expose()
  254.          * @Groups({
  255.          *     "company_legal_status",
  256.          *     "user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  257.          */
  258.         private ?string $companyLegalStatus NULL;
  259.         /**
  260.          * @deprecated
  261.          * @ORM\Column(type="string", length=255, nullable=true)
  262.          */
  263.         private $userToken;
  264.         /**
  265.          * @deprecated
  266.          * @ORM\Column(type="datetime", nullable=true)
  267.          */
  268.         private $userTokenValidity;
  269.         /**
  270.          * @deprecated
  271.          * @ORM\Column(type="integer", options={"default": 0})
  272.          */
  273.         private $userTokenAttempts 0;
  274.         /**
  275.          * Civilité
  276.          *
  277.          * @ORM\Column(type="string", length=16, nullable=true)
  278.          *
  279.          * @Expose()
  280.          * @Groups({
  281.          *     "user:civility",
  282.          *     "user:item", "default", "email","user:post", "user", "export_installer_datatable",
  283.          *     "export_purchase_declaration_datatable", "export_commercial_installer_datatable",
  284.          *                       "export_user_datatable"})
  285.          */
  286.         private $civility;
  287.         /**
  288.          * Adresse
  289.          *
  290.          * @ORM\Column(type="string", length=255, nullable=true)
  291.          *
  292.          * @Expose()
  293.          * @Groups ({"user", "user:address1", "user:item", "user:post", "email","export_installer_datatable",
  294.          *         "export_order_datatable",
  295.          *         "export_user_citroentf_datatable", "export_commercial_installer_datatable", "export_user_datatable",
  296.          *         "export_commercial_datatable","export_agency_manager_datatable"})
  297.          */
  298.         private ?string $address1 NULL;
  299.         /**
  300.          * Complément d'adresse
  301.          *
  302.          * @ORM\Column(type="string", length=255, nullable=true)
  303.          *
  304.          * @Expose()
  305.          * @Groups ({ "address2", "user:item", "user:post", "email"})
  306.          */
  307.         private ?string $address2 NULL;
  308.         /**
  309.          * Code postal
  310.          *
  311.          * @ORM\Column(type="string", length=255, nullable=true)
  312.          *
  313.          * @Expose()
  314.          * @Groups ({ "user", "user:postcode", "user:item", "user:post", "email","export_installer_datatable",
  315.          *         "export_order_datatable",
  316.          *         "export_user_citroentf_datatable", "export_commercial_installer_datatable", "export_user_datatable",
  317.          *         "export_commercial_datatable","export_agency_manager_datatable"})
  318.          */
  319.         private ?string $postcode NULL;
  320.         /**
  321.          * Ville
  322.          *
  323.          * @ORM\Column(type="string", length=255, nullable=true)
  324.          *
  325.          * @Expose()
  326.          * @Groups({"user", "user:city", "user:item", "user:post", "email","export_user_datatable",
  327.          *                  "export_order_datatable", "export_installer_datatable",
  328.          *                  "export_commercial_installer_datatable",
  329.          *                  "export_commercial_datatable","export_agency_manager_datatable"})
  330.          */
  331.         private ?string $city NULL;
  332.         /**
  333.          * @ORM\Column(type="boolean", nullable=true)
  334.          *
  335.          * @Expose()
  336.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  337.          */
  338.         private $canOrder TRUE;
  339.         /**
  340.          * Date de suppression
  341.          * @ORM\Column(type="datetime", nullable=true)
  342.          *
  343.          * @Expose()
  344.          * @Groups({"user"})
  345.          */
  346.         private $deletedAt;
  347.         /**
  348.          * Date de naissance
  349.          *
  350.          * @ORM\Column(type="datetime", nullable=true)
  351.          *
  352.          * @deprecated
  353.          */
  354.         private ?DateTimeInterface $birthDate NULL;
  355.         /**
  356.          * Lieu de naissance
  357.          *
  358.          * @deprecated
  359.          * @ORM\Column(type="string", length=255, nullable=true)
  360.          */
  361.         private ?string $birthPlace NULL;
  362.         /**
  363.          * @deprecated
  364.          * @ORM\Column(type="string", length=255, nullable=true)
  365.          */
  366.         private $socialSecurityNumber;
  367.         /**
  368.          * Identifiant interne
  369.          *
  370.          * @ORM\Column(type="string", length=80, nullable=true)
  371.          *
  372.          * @Expose()
  373.          * @Groups({
  374.          *     "user:internal_code",
  375.          *     "request_registration",
  376.          *     "export_user_datatable",
  377.          *     "user:list", "user", "user:item", "user:post", "user", "export_purchase_declaration_datatable",
  378.          *     "export_installer_datatable",
  379.          *                       "export_commercial_installer_datatable"})
  380.          */
  381.         private $internalCode;
  382.         /**
  383.          * @ORM\Column(type="datetime", nullable=true)
  384.          *
  385.          * @Expose()
  386.          * @Groups({
  387.          *     "default",
  388.          *     "user:cgu_at",
  389.          *     "user", "export_installer_datatable", "export_commercial_installer_datatable"
  390.          * })
  391.          */
  392.         private $cguAt;
  393.         /**
  394.          * @ORM\Column(type="datetime", nullable=true)
  395.          *
  396.          * @Expose()
  397.          * @Groups ({
  398.          *     "user:imported_at",
  399.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  400.          */
  401.         private $importedAt;
  402.         /**
  403.          * @ORM\Column(type="boolean", options={"default": true})
  404.          */
  405.         private $canBeContacted TRUE;
  406.         /**
  407.          * @deprecated
  408.          * @ORM\Column(type="string", length=64, nullable=true)
  409.          */
  410.         private $capacity;
  411.         /**
  412.          * @ORM\Column(type="string", length=255, nullable=true)
  413.          */
  414.         private $address3;
  415.         /**
  416.          * @ORM\Column(type="boolean", options={"default": false})
  417.          */
  418.         private $optinMail FALSE;
  419.         /**
  420.          * @ORM\Column(type="boolean", options={"default": false})
  421.          */
  422.         private $optinSMS FALSE;
  423.         /**
  424.          * @ORM\Column(type="boolean", options={"default": false})
  425.          */
  426.         private $optinPostal FALSE;
  427.         /**
  428.          * @ORM\Column(type="text", nullable=true)
  429.          */
  430.         private $optinPostalAddress;
  431.         /**
  432.          * @ORM\Column(type="string", length=255, nullable=true)
  433.          */
  434.         private $source;
  435.         /**
  436.          * @deprecated
  437.          * @ORM\Column(type="integer", options={"default": 0})
  438.          */
  439.         private $level 0;
  440.         /**
  441.          * @deprecated
  442.          * @ORM\Column(type="datetime", nullable=true)
  443.          */
  444.         private $level0UpdatedAt;
  445.         /**
  446.          * @deprecated
  447.          * @ORM\Column(type="datetime", nullable=true)
  448.          */
  449.         private $level1UpdatedAt;
  450.         /**
  451.          * @deprecated
  452.          * @ORM\Column(type="datetime", nullable=true)
  453.          */
  454.         private $level2UpdatedAt;
  455.         /**
  456.          * @deprecated
  457.          * @ORM\Column(type="datetime", nullable=true)
  458.          */
  459.         private $level3UpdatedAt;
  460.         /**
  461.          * @deprecated
  462.          * @ORM\Column(type="datetime", nullable=true)
  463.          */
  464.         private $levelUpdateSeenAt;
  465.         /**
  466.          * @deprecated
  467.          * @ORM\Column(type="boolean", options={"default": true})
  468.          *
  469.          * @Expose()
  470.          * @Groups ({
  471.          *     "user:is_email_ok",
  472.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  473.          */
  474.         private $isEmailOk TRUE;
  475.         /**
  476.          * @deprecated
  477.          * @ORM\Column(type="datetime", nullable=true)
  478.          */
  479.         private $lastEmailCheck;
  480.         /**
  481.          * @deprecated
  482.          * @ORM\Column(type="string", length=255, nullable=true)
  483.          */
  484.         private $apiToken;
  485.         /**
  486.          * @ORM\Column(type="string", length=255, nullable=true)
  487.          * @Assert\NotBlank(groups={"installateur"})
  488.          * @Assert\Regex(
  489.          *     groups={"installateur"},
  490.          *     message="Le numéro SAP est invalide",
  491.          *     pattern = "/^\d{6,8}$/"),
  492.          *
  493.          * @Expose()
  494.          * @Groups({
  495.          *     "default",
  496.          *     "user:sap_account",
  497.          *     "user", "user_bussiness_result", "export_purchase_declaration_datatable",
  498.          *     "export_agency_manager_commercial_datatable",
  499.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  500.          *     "export_commercial_datatable","get:read", "purchase",
  501.          *     "export_installer_datatable"
  502.          * })
  503.          */
  504.         private $sapAccount;
  505.         /**
  506.          * @ORM\Column(type="string", length=255, nullable=true)
  507.          *
  508.          * @Expose()
  509.          * @Groups({
  510.          *     "user:sap_distributor",
  511.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  512.          */
  513.         private $sapDistributor;
  514.         /**
  515.          * @ORM\Column(type="string", length=255, nullable=true)
  516.          *
  517.          * @Expose()
  518.          * @Groups({
  519.          *     "user:distributor",
  520.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  521.          */
  522.         private $distributor;
  523.         /**
  524.          * @ORM\Column(type="string", length=255, nullable=true)
  525.          *
  526.          * @Expose()
  527.          * @Groups({
  528.          *     "user:distributor2",
  529.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  530.          */
  531.         private $distributor2;
  532.         /**
  533.          * @ORM\Column(type="boolean", nullable=true)
  534.          */
  535.         private $aggreement;
  536.         /**
  537.          * @ORM\Column(type="datetime", nullable=true)
  538.          *
  539.          * @Expose()
  540.          * @Groups({
  541.          *     "user:unsubscribed_at",
  542.          *     "user","get:read","post:read", "export_installer_datatable", "export_commercial_installer_datatable"})
  543.          */
  544.         private $unsubscribedAt;
  545.         /**
  546.          * True if the salesman is chauffage
  547.          * @ORM\Column(type="boolean", options={"default": false}, nullable=true)
  548.          *
  549.          * @Expose()
  550.          * @Groups ({
  551.          *     "user:chauffage",
  552.          *     "user", "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  553.          *     "export_commercial_datatable"})
  554.          */
  555.         private $chauffage FALSE;
  556.         /**
  557.          * @ORM\OneToMany(targetEntity=Address::class, mappedBy="user", cascade={"remove", "persist"})
  558.          */
  559.         private $addresses;
  560.         /**
  561.          * @ORM\OneToMany(targetEntity=Cart::class, mappedBy="user", cascade={"remove", "persist"})
  562.          */
  563.         private $carts;
  564.         /**
  565.          * @ORM\ManyToOne(targetEntity=User::class)
  566.          */
  567.         private $mainAccountUser;
  568.         /**
  569.          * @ORM\ManyToMany(targetEntity=Distributor::class, inversedBy="users", cascade={"persist"})
  570.          *
  571.          * @Expose()
  572.          * @Groups({
  573.          *     "user:distributors",
  574.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  575.          */
  576.         private $distributors;
  577.         /**
  578.          * @ORM\OneToMany(targetEntity=Purchase::class, mappedBy="user", cascade={"remove"})
  579.          */
  580.         private $purchases;
  581.         /**
  582.          * @ORM\OneToMany(targetEntity=Purchase::class, mappedBy="validator", cascade={"remove"})
  583.          */
  584.         private $purchasesIHaveProcessed;
  585.         /**
  586.          * @ORM\OneToMany(targetEntity=SaleOrder::class, mappedBy="user")
  587.          */
  588.         private $orders;
  589.         /**
  590.          * @ORM\OneToMany(targetEntity=GodChild::class, mappedBy="user")
  591.          */
  592.         private $godchilds;
  593.         /**
  594.          * @deprecated
  595.          * @ORM\OneToMany(targetEntity=Satisfaction::class, mappedBy="user")
  596.          */
  597.         private $satisfactions;
  598.         /**
  599.          * @ORM\OneToMany(targetEntity=RequestProductAvailable::class, mappedBy="user")
  600.          */
  601.         private $requestProductAvailables;
  602.         /**
  603.          * @ORM\OneToMany(targetEntity=UserImportHistory::class, mappedBy="importer")
  604.          */
  605.         private $userImportHistories;
  606.         /**
  607.          * @ORM\ManyToMany(targetEntity=ContactList::class, mappedBy="users")
  608.          */
  609.         private $contactLists;
  610.         /**
  611.          * @ORM\Column(type="string", length=255, nullable=true)
  612.          *
  613.          * @Expose()
  614.          * @Groups({"user", "sale_order","get:read","post:read"})
  615.          */
  616.         private $username;
  617.         /**
  618.          * @deprecated
  619.          * @ORM\Column(type="string", length=255, nullable=true)
  620.          */
  621.         private $usernameCanonical;
  622.         /**
  623.          * @deprecated
  624.          * @ORM\Column(type="string", length=255, nullable=true)
  625.          */
  626.         private $emailCanonical;
  627.         /**
  628.          * @deprecated
  629.          * @ORM\Column(type="string", length=255, nullable=true)
  630.          */
  631.         private $salt;
  632.         /**
  633.          * Date de dernière connexion
  634.          *
  635.          * @ORM\Column(type="datetime", nullable=true)
  636.          *
  637.          * @Expose()
  638.          * @Groups({
  639.          *     "user:last_login",
  640.          *     "user", "user:item", "export_installer_datatable", "export_commercial_installer_datatable",
  641.          *     "export_user_datatable"})
  642.          */
  643.         private $lastLogin;
  644.         /**
  645.          * @ORM\Column(type="string", length=64, nullable=true)
  646.          */
  647.         private $confirmationToken;
  648.         /**
  649.          * @ORM\Column(type="datetime", nullable=true)
  650.          */
  651.         private $passwordRequestedAt;
  652.         /**
  653.          * @Expose()
  654.          * @Groups ({"user:post"})
  655.          *
  656.          * @NotInPasswordHistory
  657.          */
  658.         private ?string $plainPassword NULL;
  659.         /**
  660.          * @ORM\Column(type="boolean", nullable=true)
  661.          *
  662.          * @Expose()
  663.          * @Groups({"get:read"})
  664.          */
  665.         private $credentialExpired;
  666.         /**
  667.          * @ORM\Column(type="datetime", nullable=true)
  668.          */
  669.         private $credentialExpiredAt;
  670.         use DateTrait;
  671.         // Arguments requis pour LaPoste
  672.         /**
  673.          * @ORM\OneToMany(targetEntity=Devis::class, mappedBy="user")
  674.          */
  675.         private $devis;
  676.         /**
  677.          * @ORM\ManyToOne(targetEntity=Regate::class, inversedBy="members")
  678.          * @ORM\JoinColumn(name="regate_id", referencedColumnName="id", onDelete="SET NULL")
  679.          *
  680.          * @Expose()
  681.          * @Groups({"user", "export_user_datatable"})
  682.          */
  683.         private ?Regate $regate NULL;
  684.         /**
  685.          * @ORM\Column(type="boolean", nullable=true)
  686.          */
  687.         private $donneesPersonnelles;
  688.         /**
  689.          * @ORM\OneToMany(targetEntity=PointTransaction::class, mappedBy="user", orphanRemoval=true)
  690.          */
  691.         private $pointTransactions;
  692.         /**
  693.          * @ORM\OneTomany(targetEntity=UserAnswer::class, mappedBy="user")
  694.          */
  695.         private $userAnswers;
  696.         /**
  697.          * @ORM\ManyToOne(targetEntity=User::class, inversedBy="installers")
  698.          *
  699.          * @Expose()
  700.          * @Groups({
  701.          *     "user:commercial",
  702.          *     "user","export_request_registration_datatable", "request_registration", "sale_order", "purchase",
  703.          *     "export_purchase_declaration_datatable",
  704.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  705.          */
  706.         private $commercial;
  707.         /**
  708.          * @ORM\OneToMany(targetEntity=User::class, mappedBy="commercial")
  709.          *
  710.          * @Expose()
  711.          * @Groups({
  712.          *     "user:installers"
  713.          * })
  714.          */
  715.         private $installers;
  716.         /**
  717.          * @ORM\ManyToOne(targetEntity=User::class, inversedBy="heatingInstallers")
  718.          *
  719.          * @Expose()
  720.          * @Groups({
  721.          *     "user:heating_commercial",
  722.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  723.          */
  724.         private $heatingCommercial;
  725.         /**
  726.          * @ORM\OneToMany(targetEntity=User::class, mappedBy="heatingCommercial")
  727.          */
  728.         private $heatingInstallers;
  729.         /**
  730.          * @ORM\ManyToOne(targetEntity=Agence::class, inversedBy="users", fetch="EAGER")
  731.          *
  732.          * @Expose()
  733.          * @Groups({
  734.          *     "default",
  735.          *     "user:agency",
  736.          *     "user", "user_bussiness_result", "export_purchase_declaration_datatable",
  737.          *     "export_agency_manager_commercial_datatable",
  738.          *     "export_agency_manager_datatable", "export_commercial_installer_datatable",
  739.          *     "export_commercial_datatable","get:read", "purchase",
  740.          *     "export_installer_datatable"
  741.          * })
  742.          */
  743.         private $agency;
  744.         /**
  745.          * Date d'archivage
  746.          *
  747.          * @ORM\Column(type="datetime", nullable=true)
  748.          *
  749.          * @Expose()
  750.          * @Groups({
  751.          *     "user:archived_at",
  752.          *     "default",
  753.          *     "user", "export_installer_datatable", "export_commercial_installer_datatable"
  754.          * })
  755.          */
  756.         private $archivedAt;
  757.         /**
  758.          * @ORM\Column(type="boolean", options={"default":false})
  759.          */
  760.         private $newsletter FALSE;
  761.         /**
  762.          * @ORM\OneToMany(targetEntity=UserBusinessResult::class, mappedBy="user", cascade={"persist", "remove"})
  763.          * @Expose()
  764.          * @Groups({"user:userBusinessResults","user","export_user_datatable"})
  765.          */
  766.         private Collection $userBusinessResults;
  767.         /**
  768.          * @ORM\Column(type="text", nullable=true)
  769.          *
  770.          * @Expose()
  771.          * @Groups({"cdp", "user", "user:extension1","export_user_citroentf_datatable", "user_citroentf",
  772.          *                 "export_user_citroentf_datatable",
  773.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  774.          *                 "export_commercial_installer_datatable",
  775.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  776.          */
  777.         private ?string $extension1;
  778.         /**
  779.          * @ORM\Column(type="text", nullable=true)
  780.          *
  781.          * @Expose()
  782.          * @Groups({"cdp", "user", "user:extension2", "export_user_citroentf_datatable", "user_citroentf",
  783.          *                 "export_user_citroentf_datatable",
  784.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  785.          *                 "export_commercial_installer_datatable",
  786.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  787.          */
  788.         private ?string $extension2;
  789.         /**
  790.          * @ORM\Column(type="integer", nullable=true, unique=true)
  791.          */
  792.         private $wdg;
  793.         /**
  794.          * @ORM\Column(type="string", nullable=true, unique=true)
  795.          */
  796.         private $gladyUuid;
  797. //        /**
  798. //         * @ORM\OneToOne(targetEntity=CoverageArea::class, mappedBy="user", cascade={"persist", "remove"})
  799. //         */
  800. //        private $coverageArea;
  801.         /**
  802.          * @ORM\Column(type="string", length=255, nullable=true)
  803.          */
  804.         private $transactionalEmail;
  805.         /**
  806.          * @ORM\OneToMany(targetEntity=Project::class, mappedBy="referent")
  807.          */
  808.         private $projects;
  809.         /**
  810.          * @ORM\ManyToOne(targetEntity=Programme::class, inversedBy="users")
  811.          *
  812.          * @Expose()
  813.          * @Groups({"user"})
  814.          */
  815.         private $programme;
  816.         /**
  817.          * @ORM\OneToMany(targetEntity=ServiceUser::class, mappedBy="user", orphanRemoval=true)
  818.          */
  819.         private $serviceUsers;
  820.         /**
  821.          * @ORM\ManyToOne(targetEntity=SaleOrderValidation::class, inversedBy="users")
  822.          *
  823.          * @Expose()
  824.          * @Groups({"user", "export_user_datatable"})
  825.          */
  826.         private $saleOrderValidation;
  827.         /**
  828.          * @ORM\ManyToMany(targetEntity=Univers::class, inversedBy="users")
  829.          *
  830.          */
  831.         private $universes;
  832.         /**
  833.          * @ORM\ManyToOne(targetEntity=BillingPoint::class, inversedBy="users")
  834.          *
  835.          * @Expose()
  836.          * @Groups({"user", "export_user_datatable", "billingpoint"})
  837.          */
  838.         private $billingPoint;
  839.         /**
  840.          * @ORM\OneToMany(targetEntity=Score::class, mappedBy="user", cascade={"remove"})
  841.          */
  842.         private $scores;
  843.         /**
  844.          * @ORM\OneToMany(targetEntity=ScoreObjective::class, mappedBy="user", cascade={"remove"})
  845.          */
  846.         private $scoreObjectives;
  847.         /**
  848.          * Dans la relation : target
  849.          *
  850.          * @ORM\ManyToMany(targetEntity=User::class, inversedBy="parents", cascade={"persist"})
  851.          */
  852.         private $children;
  853.         /**
  854.          * Dans la relation : source
  855.          *
  856.          * @ORM\ManyToMany(targetEntity=User::class, mappedBy="children", cascade={"persist"})
  857.          */
  858.         private $parents;
  859.         /**
  860.          * @ORM\OneToMany(targetEntity=Message::class, mappedBy="sender")
  861.          */
  862.         private $senderMessages;
  863.         /**
  864.          * @ORM\OneToMany(targetEntity=Message::class, mappedBy="receiver")
  865.          */
  866.         private $receiverMessages;
  867.         /**
  868.          * @ORM\OneToOne(targetEntity=RequestRegistration::class, inversedBy="user", cascade={"persist", "remove"})
  869.          */
  870.         private $requestRegistration;
  871.         /**
  872.          * @ORM\OneToMany(targetEntity=RequestRegistration::class, mappedBy="referent")
  873.          */
  874.         private $requestRegistrationsToValidate;
  875.         /**
  876.          * @ORM\OneToMany(targetEntity=CustomProductOrder::class, mappedBy="user", orphanRemoval=true)
  877.          */
  878.         private $customProductOrders;
  879.         /**
  880.          * @ORM\Column(type="string", length=255, options={"default":"cgu_pending"})
  881.          *
  882.          * @Expose()
  883.          * @Groups({
  884.          *     "user:status",
  885.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  886.          *     "export_user_citroentf_datatable",
  887.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  888.          *                 "export_commercial_installer_datatable",
  889.          *                 "export_commercial_datatable","export_request_registration_datatable",
  890.          *                 "export_user_datatable", "export_installer_datatable"})
  891.          */
  892.         private string $status;
  893.         /**
  894.          * @ORM\Column(type="text", nullable=true)
  895.          */
  896.         private ?string $calculatedPoints;
  897.         use UserExtensionTrait;
  898.         /**
  899.          * @ORM\OneToMany(targetEntity=CustomProduct::class, mappedBy="createdBy")
  900.          */
  901.         private $customProducts;
  902.         /**
  903.          * Adhésion de l'utilisateur
  904.          * @Expose()
  905.          * @Groups({"user" ,"user:subscription", "export_user_datatable"})
  906.          * @ORM\OneToOne(targetEntity=UserSubscription::class, inversedBy="user", cascade={"persist", "remove"})
  907.          */
  908.         private ?UserSubscription $subscription NULL;
  909.         /**
  910.          * @ORM\OneToMany(targetEntity=UserExtension::class, mappedBy="user", cascade={"persist", "remove"})
  911.          */
  912.         private $extensions;
  913.         /**
  914.          * @ORM\Column(type="string", length=255, nullable=true)
  915.          */
  916.         private $avatar;
  917.         /**
  918.          * @Vich\UploadableField(mapping="user_avatar", fileNameProperty="avatar")
  919.          * @var File
  920.          */
  921.         private $avatarFile;
  922.         /**
  923.          * @ORM\Column(type="string", length=255, nullable=true)
  924.          */
  925.         private $logo;
  926.         /**
  927.          * @Vich\UploadableField(mapping="user_logo", fileNameProperty="logo")
  928.          * @var File
  929.          */
  930.         private $logoFile;
  931.         /**
  932.          * @ORM\ManyToOne(targetEntity=PointOfSale::class, inversedBy="users",fetch="EAGER")
  933.          *
  934.          * @Expose()
  935.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  936.          */
  937.         private ?PointOfSale $pointOfSale NULL;
  938.         /**
  939.          * @ORM\ManyToMany(targetEntity=PointOfSale::class, mappedBy="managers")
  940.          */
  941.         private Collection $managedPointOfSales;
  942.         /**
  943.          * @ORM\OneToMany(targetEntity=Parameter::class, mappedBy="userRelated")
  944.          */
  945.         private Collection $relatedParameters;
  946.         /**
  947.          * @ORM\OneToMany(targetEntity=PointOfSale::class, mappedBy="createdBy")
  948.          */
  949.         private Collection $createdPointOfSales;
  950.         /**
  951.          * @ORM\OneToMany(targetEntity=PointConversionRate::class, mappedBy="owner", orphanRemoval=true)
  952.          */
  953.         private Collection $ownerPointConversionRates;
  954.         /**
  955.          * @ORM\ManyToOne(targetEntity=PointConversionRate::class, inversedBy="users")
  956.          */
  957.         private ?PointConversionRate $pointConversionRate NULL;
  958.         /**
  959.          * @ORM\Column(type="string", length=255, nullable=true)
  960.          */
  961.         private ?string $fonction NULL;
  962.         /**
  963.          * @ORM\OneToOne(targetEntity=Regate::class, inversedBy="responsable", cascade={"persist", "remove"},
  964.          *                                           fetch="EXTRA_LAZY")
  965.          */
  966.         private ?Regate $responsableRegate NULL;
  967.         /**
  968.          * @ORM\Column(type="string", length=255, nullable=true)
  969.          */
  970.         private ?string $registrationDocument NULL;
  971.         /**
  972.          * @Vich\UploadableField(mapping="user_registration_document", fileNameProperty="registrationDocument")
  973.          * @var File
  974.          */
  975.         private $registrationDocumentFile;
  976.         /**
  977.          * @ORM\OneToOne(targetEntity=CoverageArea::class, mappedBy="user", cascade={"persist", "remove"})
  978.          */
  979.         private $coverageArea;
  980.         /**
  981.          * @ORM\Column(type="string", length=128, nullable=true)
  982.          */
  983.         private ?string $oldStatus NULL;
  984.         /**
  985.          * @ORM\Column(type="datetime", nullable=true)
  986.          */
  987.         private ?DateTimeInterface $disabledAt NULL;
  988.         /**
  989.          * @ORM\Column(type="string", length=255, nullable=true)
  990.          */
  991.         private $archiveReason;
  992.         /**
  993.          * @ORM\Column(type="string", length=255, nullable=true)
  994.          */
  995.         private $unsubscribeReason;
  996.         /**
  997.          * @ORM\OneToMany(targetEntity=ActionLog::class, mappedBy="user")
  998.          *
  999.          * @Expose()
  1000.          * @Groups({
  1001.          *     "user:actionLog",
  1002.          *     "actionLog"
  1003.          *     })
  1004.          */
  1005.         private $actionLogs;
  1006.         /**
  1007.          * @ORM\Column(type="integer")
  1008.          */
  1009.         private $failedAttempts 0;
  1010.         /**
  1011.          * @ORM\Column(type="datetime", nullable=true)
  1012.          */
  1013.         private $lastFailedAttempt;
  1014.         /**
  1015.          * @ORM\Column(type="datetime", nullable=true)
  1016.          */
  1017.         private $passwordUpdatedAt;
  1018.         /**
  1019.          * @ORM\OneToMany(targetEntity=PasswordHistory::class, mappedBy="user", orphanRemoval=true, cascade={"persist"})
  1020.          */
  1021.         private $passwordHistories;
  1022.         /**
  1023.          * @ORM\Column(type="datetime", nullable=true)
  1024.          */
  1025.         private $lastActivity;
  1026.         public function __construct()
  1027.         {
  1028.             $this->addresses                      = new ArrayCollection();
  1029.             $this->carts                          = new ArrayCollection();
  1030.             $this->distributors                   = new ArrayCollection();
  1031.             $this->purchases                      = new ArrayCollection();
  1032.             $this->orders                         = new ArrayCollection();
  1033.             $this->godchilds                      = new ArrayCollection();
  1034.             $this->requestProductAvailables       = new ArrayCollection();
  1035.             $this->userImportHistories            = new ArrayCollection();
  1036.             $this->contactLists                   = new ArrayCollection();
  1037.             $this->devis                          = new ArrayCollection();
  1038.             $this->pointTransactions              = new ArrayCollection();
  1039.             $this->installers                     = new ArrayCollection();
  1040.             $this->heatingInstallers              = new ArrayCollection();
  1041.             $this->userBusinessResults            = new ArrayCollection();
  1042.             $this->projects                       = new ArrayCollection();
  1043.             $this->serviceUsers                   = new ArrayCollection();
  1044.             $this->universes                      = new ArrayCollection();
  1045.             $this->scores                         = new ArrayCollection();
  1046.             $this->scoreObjectives                = new ArrayCollection();
  1047.             $this->children                       = new ArrayCollection();
  1048.             $this->parents                        = new ArrayCollection();
  1049.             $this->requestRegistrationsToValidate = new ArrayCollection();
  1050.             $this->customProductOrders            = new ArrayCollection();
  1051.             $this->extensions                     = new ArrayCollection();
  1052.             $this->managedPointOfSales            = new ArrayCollection();
  1053.             $this->relatedParameters              = new ArrayCollection();
  1054.             $this->createdPointOfSales            = new ArrayCollection();
  1055.             $this->status                         'cgu_pending';
  1056.             $this->actionLogs                     = new ArrayCollection();
  1057.             $this->passwordHistories              = new ArrayCollection();
  1058.         }
  1059.         public function __toString(): string
  1060.         {
  1061.             return $this->getFullName();
  1062.         }
  1063.         public function __toArray(): array
  1064.         {
  1065.             return get_object_vars($this);
  1066.         }
  1067.         public function serialize(): string
  1068.         {
  1069.             return serialize(
  1070.                 [
  1071.                     $this->id,
  1072.                 ],
  1073.             );
  1074.         }
  1075.         public function __serialize(): array
  1076.         {
  1077.             return [
  1078.                 'id'       => $this->id,
  1079.                 'email'    => $this->email,
  1080.                 'password' => $this->password,
  1081.                 'salt'     => $this->salt,
  1082.             ];
  1083.         }
  1084.         public function __unserialize($serialized)
  1085.         {
  1086.             $this->id       $serialized'id' ];
  1087.             $this->email    $serialized'email' ];
  1088.             $this->password $serialized'password' ];
  1089.             $this->salt     $serialized'salt' ];
  1090.             return $this;
  1091.         }
  1092.         /**
  1093.          * ============================================================================================
  1094.          * =============================== FONCTIONS CUSTOM ===========================================
  1095.          * ============================================================================================
  1096.          */
  1097.         /**
  1098.          * Retourne la valeur d'une extension depuis son slug
  1099.          *
  1100.          * @param   string  $slug
  1101.          *
  1102.          * @return string|null
  1103.          */
  1104.         public function getExtensionBySlug(string $slug): ?string
  1105.         {
  1106.             if (!empty($this->extensions)) {
  1107.                 foreach ($this->extensions as $extension) {
  1108.                     if ($extension->getSlug() === $slug) {
  1109.                         return $extension->getValue();
  1110.                     }
  1111.                 }
  1112.             }
  1113.             return NULL;
  1114.         }
  1115.         /**
  1116.          * @Serializer\VirtualProperty()
  1117.          * @SerializedName ("unsubscribed")
  1118.          *
  1119.          * @Expose()
  1120.          * @Groups({
  1121.          *     "user:unsubscribed",
  1122.          *     "default",
  1123.          *     "unsubscribed",
  1124.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1125.          *     "export_user_citroentf_datatable",
  1126.          *     "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1127.          *     "export_commercial_installer_datatable",
  1128.          *     "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"
  1129.          * })
  1130.          *
  1131.          * @return bool
  1132.          */
  1133.         public function isUnsubscribed(): bool
  1134.         {
  1135.             return $this->status === 'unsubscribed';
  1136.         }
  1137.         /**
  1138.          * @Serializer\VirtualProperty()
  1139.          * @SerializedName ("enabled")
  1140.          *
  1141.          * @Expose()
  1142.          * @Groups({
  1143.          *     "user:enabled",
  1144.          *     "default",
  1145.          *     "enabled",
  1146.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1147.          *     "export_user_citroentf_datatable",
  1148.          *     "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1149.          *     "export_commercial_installer_datatable",
  1150.          *     "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"
  1151.          * })
  1152.          *
  1153.          * @return bool
  1154.          */
  1155.         public function isEnabled(): bool
  1156.         {
  1157.             return $this->status === 'enabled';
  1158.         }
  1159.         /**
  1160.          * @Serializer\VirtualProperty()
  1161.          * @SerializedName ("disabled")
  1162.          *
  1163.          * @Expose()
  1164.          * @Groups({
  1165.          *     "user:disabled",
  1166.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1167.          *     "export_user_citroentf_datatable",
  1168.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1169.          *                 "export_commercial_installer_datatable",
  1170.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  1171.          *
  1172.          * @return bool
  1173.          */
  1174.         public function isDisabled(): bool
  1175.         {
  1176.             return $this->status === 'disabled';
  1177.         }
  1178.         /**
  1179.          * @Serializer\VirtualProperty()
  1180.          * @SerializedName ("cgu_pending")
  1181.          *
  1182.          * @Expose()
  1183.          * @Groups({
  1184.          *     "user:cgu_pending",
  1185.          *     "cgu_pending",
  1186.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1187.          *     "export_user_citroentf_datatable",
  1188.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1189.          *                 "export_commercial_installer_datatable",
  1190.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  1191.          *
  1192.          * @return bool
  1193.          */
  1194.         public function isCguPending(): bool
  1195.         {
  1196.             return $this->status === 'cgu_pending';
  1197.         }
  1198.         /**
  1199.          * @Serializer\VirtualProperty()
  1200.          * @SerializedName ("cgu_declined")
  1201.          *
  1202.          * @Expose()
  1203.          * @Groups({
  1204.          *     "user:cgu_declined",
  1205.          *     "cgu_declined",
  1206.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1207.          *     "export_user_citroentf_datatable",
  1208.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1209.          *                 "export_commercial_installer_datatable",
  1210.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  1211.          *
  1212.          * @return bool
  1213.          */
  1214.         public function isCguDeclined(): bool
  1215.         {
  1216.             return $this->status === 'cgu_declined';
  1217.         }
  1218.         /**
  1219.          * @Serializer\VirtualProperty()
  1220.          * @SerializedName ("archived")
  1221.          *
  1222.          * @Expose()
  1223.          * @Groups({
  1224.          *     "user:archived",
  1225.          *     "default",
  1226.          *     "is_archived",
  1227.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1228.          *     "export_user_citroentf_datatable",
  1229.          *     "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1230.          *     "export_commercial_installer_datatable",
  1231.          *     "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"
  1232.          * })
  1233.          *
  1234.          * @return bool
  1235.          */
  1236.         public function isArchived(): bool
  1237.         {
  1238.             return $this->status === 'archived';
  1239.         }
  1240.         /**
  1241.          * @Serializer\VirtualProperty()
  1242.          * @SerializedName ("deleted")
  1243.          *
  1244.          * @Expose()
  1245.          * @Groups({
  1246.          *     "user:deleted",
  1247.          *     "user:list", "user:item", "cdp", "user", "export_user_citroentf_datatable", "user_citroentf",
  1248.          *     "export_user_citroentf_datatable",
  1249.          *                 "export_agency_manager_commercial_datatable", "export_agency_manager_datatable",
  1250.          *                 "export_commercial_installer_datatable",
  1251.          *                 "export_commercial_datatable", "export_user_datatable", "export_installer_datatable"})
  1252.          *
  1253.          * @return bool
  1254.          */
  1255.         public function isDeleted(): bool
  1256.         {
  1257.             return $this->status === 'deleted';
  1258.         }
  1259.         /**
  1260.          * @Serializer\VirtualProperty()
  1261.          * @SerializedName ("admin_pending")
  1262.          *
  1263.          * @return bool
  1264.          */
  1265.         public function isAdminPending(): bool
  1266.         {
  1267.             return $this->status === 'admin_pending';
  1268.         }
  1269.         /**
  1270.          * @Serializer\VirtualProperty
  1271.          * @SerializedName("fullName")
  1272.          *
  1273.          * @Expose()
  1274.          * @Groups({"user:full_name","email", "export_order_datatable", "purchase", "service_user",
  1275.          *                                    "univers","customProductOrder:list"})
  1276.          *
  1277.          * @return string
  1278.          */
  1279.         public function getFullName(): string
  1280.         {
  1281.             return trim($this->firstName).' '.trim($this->lastName);
  1282.         }
  1283.         public function getUsers()
  1284.         {
  1285.             return $this->installers;
  1286.         }
  1287.         /**
  1288.          * @Serializer\VirtualProperty()
  1289.          * @SerializedName("count_installers")
  1290.          *
  1291.          * @Expose()
  1292.          * @Groups({
  1293.          *      "user:count_installers"
  1294.          * })
  1295.          *
  1296.          * @return int
  1297.          */
  1298.         public function countInstallers(): int
  1299.         {
  1300.             return count($this->installers);
  1301.         }
  1302.         /**
  1303.          * @Serializer\VirtualProperty()
  1304.          * @SerializedName("count_commercials")
  1305.          *
  1306.          * @Expose()
  1307.          * @Groups({
  1308.          *      "user:count_commercials"
  1309.          * })
  1310.          *
  1311.          * @return int
  1312.          */
  1313.         public function countCommercials(): int
  1314.         {
  1315.             $commercials $this->children;
  1316.             if (empty($commercials)) {
  1317.                 return 0;
  1318.             }
  1319.             foreach ($commercials as $index => $commercial) {
  1320.                 if (!in_array('ROLE_COMMERCIAL'$commercial->getRoles())) {
  1321.                     unset($commercials$index ]);
  1322.                 }
  1323.             }
  1324.             return count($commercials);
  1325.         }
  1326.         /**
  1327.          * @Serializer\VirtualProperty
  1328.          * @SerializedName("preferredEmail")
  1329.          *
  1330.          * @Expose()
  1331.          * @Groups({"email"})
  1332.          *
  1333.          * @return string
  1334.          */
  1335.         public function getPreferredEmail(): string
  1336.         {
  1337.             if ($this->getTransactionalEmail() !== NULL) {
  1338.                 return $this->getTransactionalEmail();
  1339.             }
  1340.             return $this->email;
  1341.         }
  1342.         public function getTransactionalEmail(): ?string
  1343.         {
  1344.             return $this->transactionalEmail;
  1345.         }
  1346.         public function setTransactionalEmail(?string $transactionalEmail): User
  1347.         {
  1348.             $this->transactionalEmail $transactionalEmail;
  1349.             return $this;
  1350.         }
  1351.         /**
  1352.          * @Serializer\VirtualProperty()
  1353.          * @SerializedName ("roleToString")
  1354.          *
  1355.          * @Expose()
  1356.          * @Groups({"export_user_datatable", "export_user_citroentf_datatable"})
  1357.          *
  1358.          * @return string
  1359.          */
  1360.         public function roleToString(): string
  1361.         {
  1362.             if ($this->isDemo()) {
  1363.                 return 'Démo';
  1364.             }
  1365.             if ($this->isInstaller()) {
  1366.                 return 'Installateur';
  1367.             }
  1368.             if ($this->isValidation()) {
  1369.                 return 'Validation';
  1370.             }
  1371.             if ($this->isUser()) {
  1372.                 return 'Utilisateur';
  1373.             }
  1374.             if ($this->isCommercial()) {
  1375.                 if ($this->isHeatingCommercial()) {
  1376.                     return 'Commercial chauffage';
  1377.                 }
  1378.                 return 'Commercial';
  1379.             }
  1380.             if ($this->isAgencyManager()) {
  1381.                 return "Directeur d'agence";
  1382.             }
  1383.             if ($this->isDtvLogistique()) {
  1384.                 return "Logistique";
  1385.             }
  1386.             if ($this->isDtvCommercial()) {
  1387.                 return "Commercial";
  1388.             }
  1389.             if ($this->isDtvCompta()) {
  1390.                 return "Comptabilité";
  1391.             }
  1392.             if ($this->isDtvCdp()) {
  1393.                 return "Chef de projet";
  1394.             }
  1395.             if ($this->isAdmin()) {
  1396.                 return 'Administrateur';
  1397.             }
  1398.             if ($this->isSuperAdmin()) {
  1399.                 return 'Super Administrateur';
  1400.             }
  1401.             if ($this->isDeveloper()) {
  1402.                 return 'Développeur';
  1403.             }
  1404.             return 'Rôle non défini';
  1405.         }
  1406.         public function isDemo(): bool
  1407.         {
  1408.             return in_array('ROLE_DEMO'$this->getRoles(), TRUE);
  1409.         }
  1410.         public function getRoles(): ?array
  1411.         {
  1412.             return $this->roles;
  1413.         }
  1414.         public function setRoles(array $roles): User
  1415.         {
  1416.             $this->roles $roles;
  1417.             return $this;
  1418.         }
  1419.         public function isInstaller(): bool
  1420.         {
  1421.             return in_array('ROLE_INSTALLER'$this->getRoles(), TRUE);
  1422.         }
  1423.         public function isValidation(): bool
  1424.         {
  1425.             return in_array('ROLE_VALIDATION'$this->getRoles(), TRUE);
  1426.         }
  1427.         public function isUser(): bool
  1428.         {
  1429.             return in_array('ROLE_USER'$this->getRoles(), TRUE);
  1430.         }
  1431.         public function isCommercial(): bool
  1432.         {
  1433.             return in_array('ROLE_COMMERCIAL'$this->getRoles(), TRUE);
  1434.         }
  1435.         public function isHeatingCommercial(): bool
  1436.         {
  1437.             return in_array('ROLE_COMMERCIAL'$this->getRoles(), TRUE) && $this->getChauffage();
  1438.         }
  1439.         public function getChauffage(): ?bool
  1440.         {
  1441.             return $this->chauffage;
  1442.         }
  1443.         public function setChauffage(?bool $chauffage): User
  1444.         {
  1445.             $this->chauffage $chauffage;
  1446.             return $this;
  1447.         }
  1448.         public function isAgencyManager(): bool
  1449.         {
  1450.             return in_array('ROLE_AGENCY_MANAGER'$this->getRoles(), TRUE);
  1451.         }
  1452.         public function isDtvLogistique(): bool
  1453.         {
  1454.             return in_array('ROLE_DTV_LOGISTIQUE'$this->getRoles(), TRUE);
  1455.         }
  1456.         public function isDtvCommercial(): bool
  1457.         {
  1458.             return in_array('ROLE_DTV_COMMERCIAL'$this->getRoles(), TRUE);
  1459.         }
  1460.         public function isDtvCompta(): bool
  1461.         {
  1462.             return in_array('ROLE_DTV_COMPTA'$this->getRoles(), TRUE);
  1463.         }
  1464.         public function isDtvCdp(): bool
  1465.         {
  1466.             return in_array('ROLE_DTV_CDP'$this->getRoles(), TRUE);
  1467.         }
  1468.         public function isAdmin(): bool
  1469.         {
  1470.             return in_array('ROLE_ADMIN'$this->getRoles(), TRUE);
  1471.         }
  1472.         public function isSuperAdmin(): bool
  1473.         {
  1474.             return in_array('ROLE_SUPER_ADMIN'$this->getRoles(), TRUE);
  1475.         }
  1476.         public function isDeveloper(): bool
  1477.         {
  1478.             return in_array('ROLE_DEVELOPER'$this->getRoles(), TRUE);
  1479.         }
  1480.         public function hasOneOfItsRoles(array $roles): bool
  1481.         {
  1482.             return count(array_intersect($roles$this->getRoles())) > 0;
  1483.         }
  1484.         /**
  1485.          * @Serializer\VirtualProperty()
  1486.          * @SerializedName ("nbrValidatedPurchases")
  1487.          *
  1488.          * @Expose()
  1489.          * @Groups({
  1490.          *     "user:nbr_validated_purchases",
  1491.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  1492.          *
  1493.          * @return int
  1494.          */
  1495.         public function getNbrValidatedPurchases(): int
  1496.         {
  1497.             $nbr 0;
  1498.             /** @var Purchase $purchase */
  1499.             foreach ($this->purchases as $purchase) {
  1500.                 if ((int)$purchase->getStatus() === Purchase::STATUS_VALIDATED) {
  1501.                     $nbr++;
  1502.                 }
  1503.             }
  1504.             return $nbr;
  1505.         }
  1506.         /**
  1507.          * @Serializer\VirtualProperty()
  1508.          * @SerializedName ("nbrPendingPurchases")
  1509.          *
  1510.          * @Expose()
  1511.          * @Groups({"export_installer_datatable", "export_commercial_installer_datatable"})
  1512.          *
  1513.          * @return int
  1514.          */
  1515.         public function getNbrPendingPurchases(): int
  1516.         {
  1517.             $nbr 0;
  1518.             /** @var Purchase $purchase */
  1519.             foreach ($this->purchases as $purchase) {
  1520.                 if ((int)$purchase->getStatus() === Purchase::STATUS_PENDING) {
  1521.                     $nbr++;
  1522.                 }
  1523.             }
  1524.             return $nbr;
  1525.         }
  1526.         /**
  1527.          * @Serializer\VirtualProperty()
  1528.          * @SerializedName ("nbrRejectedPurchases")
  1529.          *
  1530.          * @Expose()
  1531.          * @Groups({
  1532.          *     "user:nbr_rejected_purchases",
  1533.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  1534.          *
  1535.          * @return int
  1536.          */
  1537.         public function getNbrRejectedPurchases(): int
  1538.         {
  1539.             $nbr 0;
  1540.             /** @var Purchase $purchase */
  1541.             foreach ($this->purchases as $purchase) {
  1542.                 if ((int)$purchase->getStatus() === Purchase::STATUS_REJECTED) {
  1543.                     $nbr++;
  1544.                 }
  1545.             }
  1546.             return $nbr;
  1547.         }
  1548.         /**
  1549.          * @Serializer\VirtualProperty()
  1550.          * @SerializedName ("nbrReturnedPurchases")
  1551.          *
  1552.          * @Expose()
  1553.          * @Groups({
  1554.          *     "user:nbr_returned_purchases",
  1555.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  1556.          *
  1557.          * @return int
  1558.          */
  1559.         public function getNbrReturnedPurchases(): int
  1560.         {
  1561.             $nbr 0;
  1562.             /** @var Purchase $purchase */
  1563.             foreach ($this->purchases as $purchase) {
  1564.                 if ((int)$purchase->getStatus() === Purchase::STATUS_RETURNED) {
  1565.                     $nbr++;
  1566.                 }
  1567.             }
  1568.             return $nbr;
  1569.         }
  1570.         /**
  1571.          * Nombre de commandes de l'utilisateur
  1572.          *
  1573.          * @Serializer\VirtualProperty()
  1574.          * @SerializedName ("nbrOrder")
  1575.          *
  1576.          * @Expose()
  1577.          * @Groups({"export_user_datatable", "export_installer_datatable", "export_commercial_installer_datatable"})
  1578.          *
  1579.          * @return int
  1580.          */
  1581.         public function getNbrOrder(): int
  1582.         {
  1583.             return count($this->orders);
  1584.         }
  1585.         /**
  1586.          * @Serializer\VirtualProperty()
  1587.          * @SerializedName ("nbrPurchases")
  1588.          *
  1589.          * @Expose()
  1590.          * @Groups({
  1591.          *     "user:nbr_purchases",
  1592.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  1593.          *
  1594.          * @return int
  1595.          */
  1596.         public function getNbrPurchases(): int
  1597.         {
  1598.             return count($this->purchases);
  1599.         }
  1600.         /**
  1601.          * @Serializer\VirtualProperty()
  1602.          * @SerializedName ("has_heating_commercial")
  1603.          * @Groups ({
  1604.          *     "default",
  1605.          *     "user:has_heating_commercial",
  1606.          *     "user"
  1607.          * })
  1608.          */
  1609.         public function hasHeatingCommercial()
  1610.         {
  1611.             return $this->heatingCommercial instanceof User;
  1612.         }
  1613.         /**
  1614.          * @Serializer\VirtualProperty()
  1615.          * @SerializedName ("pointDateExpiration")
  1616.          *
  1617.          * @Expose()
  1618.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1619.          *
  1620.          * @return null|string
  1621.          */
  1622.         public function getPointDateExpiration(): ?string
  1623.         {
  1624.             return $this->getExtensionBySlug(\App\Constants\UserExtension::POINT_DATE_EXPIRATION);
  1625.         }
  1626.         /**
  1627.          * @Serializer\VirtualProperty()
  1628.          * @SerializedName ("objCa")
  1629.          *
  1630.          * @Expose()
  1631.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1632.          *
  1633.          * @return int
  1634.          */
  1635.         public function getObjCa(): int
  1636.         {
  1637.             $value $this->getExtensionBySlug(\App\Constants\UserExtension::OBJ_CA);
  1638.             if ($value === NULL) {
  1639.                 return 0;
  1640.             }
  1641.             return intval($value);
  1642.         }
  1643.         public function setObjCa(?string $value): User
  1644.         {
  1645.             if ($value === NULL) {
  1646.                 return $this;
  1647.             }
  1648.             $this->addExtension(UserExtensionFactory::setObjCa($this$value));
  1649.             return $this;
  1650.         }
  1651.         /**
  1652.          * @Serializer\VirtualProperty()
  1653.          * @SerializedName ("commitment_level")
  1654.          *
  1655.          * @Expose()
  1656.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1657.          *
  1658.          * @return string
  1659.          */
  1660.         public function getCommitmentLevel(): string
  1661.         {
  1662.             $value $this->getExtensionBySlug(\App\Constants\UserExtension::COMMITMENT_LEVEL);
  1663.             if ($value === NULL) {
  1664.                 return '';
  1665.             }
  1666.             return $value;
  1667.         }
  1668.         public function setCommitmentLevel(?string $value): User
  1669.         {
  1670.             if ($value === NULL) {
  1671.                 return $this;
  1672.             }
  1673.             $this->addExtension(UserExtensionFactory::setCommitmentLevel($this$value));
  1674.             return $this;
  1675.         }
  1676.         /**
  1677.          * @Serializer\VirtualProperty()
  1678.          * @SerializedName ("objPoint")
  1679.          *
  1680.          * @Expose()
  1681.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1682.          *
  1683.          * @return int
  1684.          */
  1685.         public function getObjPoint(): int
  1686.         {
  1687.             $value $this->getExtensionBySlug(\App\Constants\UserExtension::OBJ_POINT);
  1688.             if ($value === NULL) {
  1689.                 return 0;
  1690.             }
  1691.             return intval($value);
  1692.         }
  1693.         public function setObjPoint(?string $value): User
  1694.         {
  1695.             if ($value === NULL) {
  1696.                 return $this;
  1697.             }
  1698.             $this->addExtension(UserExtensionFactory::setObjPoint($this$value));
  1699.             return $this;
  1700.         }
  1701.         /**
  1702.          * @Serializer\VirtualProperty()
  1703.          * @SerializedName ("language")
  1704.          *
  1705.          * @Expose()
  1706.          * @Groups({ "user:language", "user:item"})
  1707.          *
  1708.          * @return string|null
  1709.          */
  1710.         public function getLanguage(): ?string
  1711.         {
  1712.             return $this->getExtensionBySlug(\App\Constants\UserExtension::LANGUAGE);
  1713.         }
  1714.         /**
  1715.          * @Serializer\VirtualProperty()
  1716.          * @SerializedName ("internalIdentification1")
  1717.          *
  1718.          * @Expose()
  1719.          * @Groups({
  1720.          *     "user:internal_identification_1",
  1721.          *     "user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable", "sale_order",
  1722.          *     "export_order_datatable",
  1723.          *                       "export_installer_datatable",
  1724.          *                       "export_commercial_datatable","export_agency_manager_datatable"})
  1725.          *
  1726.          * @return string|null
  1727.          */
  1728.         public function getInternalIdentification1(): ?string
  1729.         {
  1730.             return $this->getExtensionBySlug(\App\Constants\UserExtension::INTERNAL_IDENTIFICATION_1);
  1731.         }
  1732.         public function setInternalIdentification1(?string $value): User
  1733.         {
  1734.             if ($value === NULL) {
  1735.                 return $this;
  1736.             }
  1737.             $this->addExtension(UserExtensionFactory::setInternalIdentification1($this$value));
  1738.             return $this;
  1739.         }
  1740.         /**
  1741.          * @Serializer\VirtualProperty()
  1742.          * @SerializedName ("internalIdentification2")
  1743.          *
  1744.          * @Expose()
  1745.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable", "sale_order",
  1746.          *                       "export_order_datatable"})
  1747.          *
  1748.          * @return string|null
  1749.          */
  1750.         public function getInternalIdentification2(): ?string
  1751.         {
  1752.             return $this->getExtensionBySlug(\App\Constants\UserExtension::INTERNAL_IDENTIFICATION_2);
  1753.         }
  1754.         public function setInternalIdentification2(?string $value): User
  1755.         {
  1756.             if ($value === NULL) {
  1757.                 return $this;
  1758.             }
  1759.             $this->addExtension(UserExtensionFactory::setInternalIdentification2($this$value));
  1760.             return $this;
  1761.         }
  1762.         /**
  1763.          * @Serializer\VirtualProperty()
  1764.          * @SerializedName ("internalIdentification3")
  1765.          *
  1766.          * @Expose()
  1767.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1768.          *
  1769.          * @return string|null
  1770.          */
  1771.         public function getInternalIdentification3(): ?string
  1772.         {
  1773.             return $this->getExtensionBySlug(\App\Constants\UserExtension::INTERNAL_IDENTIFICATION_3);
  1774.         }
  1775.         public function setInternalIdentification3(?string $value): User
  1776.         {
  1777.             if ($value === NULL) {
  1778.                 return $this;
  1779.             }
  1780.             $this->addExtension(UserExtensionFactory::setInternalIdentification3($this$value));
  1781.             return $this;
  1782.         }
  1783.         /**
  1784.          * @Serializer\VirtualProperty()
  1785.          * @SerializedName ("potentialPoints")
  1786.          *
  1787.          * @Expose
  1788.          * @Groups({
  1789.          *     "user:potentialPoints",
  1790.          *     "user:list",
  1791.          *     "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1792.          *
  1793.          * @return int|null
  1794.          */
  1795.         public function getPotentialPoints(): ?int
  1796.         {
  1797.             return (int)($this->getExtensionBySlug(\App\Constants\UserExtension::POTENTIAL_POINTS));
  1798.         }
  1799.         public function setPotentialPoints(?string $value): User
  1800.         {
  1801.             if ($value === NULL) {
  1802.                 return $this;
  1803.             }
  1804.             $this->addExtension(UserExtensionFactory::setPotentialPoints($this$value));
  1805.             return $this;
  1806.         }
  1807.         /**
  1808.          * @Serializer\VirtualProperty()
  1809.          * @SerializedName ("parent_lvl_1")
  1810.          * @Groups ({"user", "point_of_sale"})
  1811.          *
  1812.          * @return int|null
  1813.          */
  1814.         public function getParentLvl1(): int
  1815.         {
  1816.             // Boucle sur les commerciaux et retourne le premier
  1817.             foreach ($this->parents as $parent) {
  1818.                 return $parent->getId();
  1819.             }
  1820.             return -1;
  1821.         }
  1822.         /**
  1823.          * @Serializer\VirtualProperty()
  1824.          * @SerializedName ("parent_lvl_1_code")
  1825.          * @Groups ({"user", "export_user_datatable", "sale_order", "export_order_datatable",
  1826.          *         "export_commercial_datatable"})
  1827.          *
  1828.          * @return string|null
  1829.          */
  1830.         public function getParentLvl1Code(): ?string
  1831.         {
  1832.             // Boucle sur les commerciaux et retourne le premier
  1833.             foreach ($this->parents as $parent) {
  1834.                 return $parent->getInternalIdentification1();
  1835.             }
  1836.             return NULL;
  1837.         }
  1838.         /**
  1839.          * @Serializer\VirtualProperty()
  1840.          * @SerializedName ("parent_lvl_2")
  1841.          * @Groups ({"user", "point_of_sale"})
  1842.          *
  1843.          * @return int|null
  1844.          */
  1845.         public function getParentLvl2(): int
  1846.         {
  1847.             //  Boucle sur les commerciaux
  1848.             foreach ($this->parents as $parent) {
  1849.                 // Boucle sur les chefs d'agence et retourne le premier
  1850.                 foreach ($parent->getParents() as $grandParent) {
  1851.                     return $grandParent->getId();
  1852.                 }
  1853.             }
  1854.             return -1;
  1855.         }
  1856.         /**
  1857.          * @Serializer\VirtualProperty()
  1858.          * @SerializedName ("parent_lvl_3")
  1859.          * @Groups ({"user", "point_of_sale"})
  1860.          *
  1861.          * @return int|null
  1862.          */
  1863.         public function getParentLvl3(): int
  1864.         {
  1865.             //  Boucle sur les commerciaux
  1866.             foreach ($this->parents as $parent) {
  1867.                 // Boucle sur les chefs d'agence et retourne le premier
  1868.                 foreach ($parent->getParents() as $grandParent) {
  1869.                     // Boucle sur les admins et retourne le premier
  1870.                     foreach ($grandParent->getParents() as $ggparent) {
  1871.                         return $ggparent->getId();
  1872.                     }
  1873.                 }
  1874.             }
  1875.             return -1;
  1876.         }
  1877.         /**
  1878.          * @Serializer\VirtualProperty()
  1879.          * @SerializedName ("pointOfSaleOfClient")
  1880.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1881.          *
  1882.          * @return string|null
  1883.          */
  1884.         public function getPointOfSaleOfClient(): ?string
  1885.         {
  1886.             //  Boucle sur les commerciaux
  1887.             if (!empty($this->parents)) {
  1888.                 foreach ($this->parents as $parent) {
  1889.                     if ($parent->getPointOfSale() !== NULL) {
  1890.                         return $parent->getPointOfSale()->getCode();
  1891.                     } else {
  1892.                         return NULL;
  1893.                     }
  1894.                 }
  1895.             }
  1896.             return NULL;
  1897.         }
  1898.         /**
  1899.          * @Serializer\VirtualProperty()
  1900.          * @SerializedName ("pointOfSaleOfCommercial")
  1901.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1902.          *
  1903.          * @return string|null
  1904.          */
  1905.         public function getPointOfSaleOfCommercial(): ?string
  1906.         {
  1907.             //  Boucle sur les commerciaux
  1908.             if ($this->getPointOfSale() !== NULL) {
  1909.                 return $this->getPointOfSale()->getCode();
  1910.             } else {
  1911.                 return NULL;
  1912.             }
  1913.         }
  1914.         /**
  1915.          * Retourne la date d'adhésion du client s'il en a une
  1916.          *
  1917.          * @Serializer\VirtualProperty()
  1918.          * @SerializedName ("subscribedAt")
  1919.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1920.          *
  1921.          * @return DateTimeInterface|null
  1922.          */
  1923.         public function getSubscribedAt(): string
  1924.         {
  1925.             if ($this->subscription instanceof UserSubscription) {
  1926.                 return $this->subscription->getSubscribedAt()->format('d/m/Y');
  1927.             }
  1928.             return '';
  1929.         }
  1930.         /**
  1931.          * Retourne le label de la catégorie du taux de conversion des points
  1932.          *
  1933.          * @Serializer\VirtualProperty()
  1934.          * @SerializedName ("pointConvertionRateLabel")
  1935.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  1936.          *
  1937.          * @return string
  1938.          */
  1939.         public function getPointConvertionRateLabel(): string
  1940.         {
  1941.             if ($this->pointConversionRate instanceof PointConversionRate) {
  1942.                 return $this->pointConversionRate->getLabel();
  1943.             }
  1944.             return '';
  1945.         }
  1946.         /**
  1947.          * ============================================================================================
  1948.          * ============================= FIN FONCTIONS CUSTOM =========================================
  1949.          * ============================================================================================
  1950.          */
  1951.         public function getId(): ?int
  1952.         {
  1953.             return $this->id;
  1954.         }
  1955.         public function getNameCiv(): string
  1956.         {
  1957.             return trim($this->getCivility().' '.trim($this->lastName." ".$this->firstName));
  1958.         }
  1959.         public function getCivility(): ?string
  1960.         {
  1961.             return $this->civility;
  1962.         }
  1963.         public function setCivility(?string $civility): User
  1964.         {
  1965.             $this->civility $civility;
  1966.             return $this;
  1967.         }
  1968.         public function getCivCode(): int
  1969.         {
  1970.             if ($this->getCivility() == 'M.') {
  1971.                 return 0;
  1972.             } elseif ($this->getCivility() == 'Mme') {
  1973.                 return 1;
  1974.             } else {
  1975.                 return 2;
  1976.             }
  1977.         }
  1978.         /**
  1979.          * @return void
  1980.          * @deprecated
  1981.          */
  1982.         public function setActive()
  1983.         {
  1984.             $this->deletedAt  NULL;
  1985.             $this->archivedAt NULL;
  1986.         }
  1987.         public function isPurchaseAuthorized(): bool
  1988.         {
  1989.             return in_array('ROLE_INSTALLER'$this->getRoles()) || in_array('ROLE_SUPER_ADMIN'$this->getRoles());
  1990.         }
  1991.         public function getBillingAddresses()
  1992.         {
  1993.             return $this->getAddressByType(Address::TYPE_BILLING_ADDRESS);
  1994.         }
  1995.         /**
  1996.          * @param $type
  1997.          *
  1998.          * @return Collection
  1999.          */
  2000.         private function getAddressByType($type)
  2001.         {
  2002.             $shippingAddress = new ArrayCollection();
  2003.             foreach ($this->getAddresses() as $address) {
  2004.                 if ($address->getAddressType() == $type) {
  2005.                     $shippingAddress->add($address);
  2006.                 }
  2007.             }
  2008.             return $shippingAddress;
  2009.         }
  2010.         /**
  2011.          * @return Collection|Address[]
  2012.          */
  2013.         public function getAddresses(): Collection
  2014.         {
  2015.             return $this->addresses;
  2016.         }
  2017.         /**
  2018.          * @return DateTimeInterface|null
  2019.          * @deprecated
  2020.          */
  2021.         public function getLevel1UpdatedAt(): ?DateTimeInterface
  2022.         {
  2023.             return $this->level1UpdatedAt;
  2024.         }
  2025.         /**
  2026.          * @param   DateTimeInterface|null  $level1UpdatedAt
  2027.          *
  2028.          * @return $this
  2029.          * @deprecated
  2030.          */
  2031.         public function setLevel1UpdatedAt(?DateTimeInterface $level1UpdatedAt): User
  2032.         {
  2033.             $this->level1UpdatedAt $level1UpdatedAt;
  2034.             return $this;
  2035.         }
  2036.         /*
  2037.                                           * ============================================================================================
  2038.                                           * ============================== FIN FONCTIONS CUSTOM ========================================
  2039.                                           * ============================================================================================
  2040.                                           */
  2041.         /**
  2042.          * @return DateTimeInterface|null
  2043.          * @deprecated
  2044.          */
  2045.         public function getLevel2UpdatedAt(): ?DateTimeInterface
  2046.         {
  2047.             return $this->level2UpdatedAt;
  2048.         }
  2049.         /**
  2050.          * @param   DateTimeInterface|null  $level2UpdatedAt
  2051.          *
  2052.          * @return $this
  2053.          * @deprecated
  2054.          */
  2055.         public function setLevel2UpdatedAt(?DateTimeInterface $level2UpdatedAt): User
  2056.         {
  2057.             $this->level2UpdatedAt $level2UpdatedAt;
  2058.             return $this;
  2059.         }
  2060.         /**
  2061.          * @Serializer\VirtualProperty
  2062.          * @SerializedName("name")
  2063.          * @Groups({
  2064.          *     "user:name",
  2065.          *     "export_installer_datatable", "export_purchase_declaration_datatable",
  2066.          *     "export_agency_manager_commercial_datatable",
  2067.          *                                        "export_commercial_installer_datatable"})
  2068.          *
  2069.          * @return string
  2070.          */
  2071.         public function getName(): string
  2072.         {
  2073.             return $this->lastName." ".$this->firstName;
  2074.         }
  2075.         /**
  2076.          * @Serializer\VirtualProperty()
  2077.          * @SerializedName("codeDep")
  2078.          * @Expose()
  2079.          * @Groups({
  2080.          *     "user:code_dep",
  2081.          *     "export_installer_datatable", "export_commercial_installer_datatable"})
  2082.          *
  2083.          * @return false|string|null
  2084.          */
  2085.         public function getCodeDep()
  2086.         {
  2087.             return $this->getPostcode() !== NULL substr($this->getPostcode(), 02) : NULL;
  2088.         }
  2089.         public function getPostcode(): ?string
  2090.         {
  2091.             return $this->postcode;
  2092.         }
  2093.         public function setPostcode(?string $postcode): User
  2094.         {
  2095.             $this->postcode $postcode;
  2096.             return $this;
  2097.         }
  2098.         public function getShippingAddresses()
  2099.         {
  2100.             return $this->getAddressByType(Address::TYPE_SHIPPING_ADDRESS);
  2101.         }
  2102.         /**
  2103.          * GARDER POUR LA SSO
  2104.          *
  2105.          * @return string
  2106.          */
  2107.         public function getUsername(): string
  2108.         {
  2109.             return (string)$this->email;
  2110.         }
  2111.         /**
  2112.          * GARDER POUR LA SSO
  2113.          *
  2114.          * @return string
  2115.          */
  2116.         public function getUserIdentifier(): string
  2117.         {
  2118.             return (string)$this->email;
  2119.         }
  2120.         /**
  2121.          * @param   string|null  $username
  2122.          *
  2123.          * @return $this
  2124.          * @deprecated
  2125.          */
  2126.         public function setUsername(?string $username): User
  2127.         {
  2128.             $this->username $username;
  2129.             return $this;
  2130.         }
  2131.         public function isDex(): bool
  2132.         {
  2133.             return TRUE;
  2134.         }
  2135.         public function getWelcomeEmail(): ?DateTimeInterface
  2136.         {
  2137.             return $this->welcomeEmail;
  2138.         }
  2139.         public function setWelcomeEmail(?DateTimeInterface $welcomeEmail): User
  2140.         {
  2141.             $this->welcomeEmail $welcomeEmail;
  2142.             return $this;
  2143.         }
  2144.         public function getAccountAddress(): string
  2145.         {
  2146.             return trim($this->address1.' '.$this->address2).' '.$this->postcode.' '.$this->city;
  2147.         }
  2148.         public function eraseCredentials()
  2149.         {
  2150.             // If you store any temporary, sensitive data on the user, clear it here
  2151.             $this->plainPassword NULL;
  2152.         }
  2153.         public function generateAndSetPassword()
  2154.         {
  2155.             $pwd substr(str_shuffle('23456789QWERTYUPASDFGHJKLZXCVBNM'), 012);
  2156.             $this->setPassword($pwd);
  2157.             return $pwd;
  2158.         }
  2159.         public function getEmail(): ?string
  2160.         {
  2161.             return $this->email;
  2162.         }
  2163.         public function setEmail(string $email): User
  2164.         {
  2165.             $this->email $email;
  2166.             return $this;
  2167.         }
  2168.         public function getPassword(): ?string
  2169.         {
  2170.             return $this->password;
  2171.         }
  2172.         public function setPassword(string $password): User
  2173.         {
  2174.             // Chaque fois que le mot de passe est modifié, mettre à jour la date
  2175.             // et remettre à 0 le compteur d'essai
  2176.             $this->passwordUpdatedAt = new DateTime();
  2177.             $this->setFailedAttempts(0);
  2178.             $this->password $password;
  2179.             return $this;
  2180.         }
  2181.         public function getSalt(): ?string
  2182.         {
  2183.             return $this->salt;
  2184.         }
  2185.         public function setSalt(?string $salt): User
  2186.         {
  2187.             $this->salt $salt;
  2188.             return $this;
  2189.         }
  2190.         public function getPlainPassword(): ?string
  2191.         {
  2192.             return $this->plainPassword;
  2193.         }
  2194.         public function setPlainPassword($plainPassword): User
  2195.         {
  2196.             // Ajout de l'ancien mot de passe dans l'historique
  2197.             if ($plainPassword !== NULL) {
  2198.                 $passwordHistory = new PasswordHistory();
  2199.                 $passwordHistory->setUser($this);
  2200.                 $passwordHistory->setHashedPassword(md5($plainPassword));
  2201.                 $this->passwordHistories[] = $passwordHistory;
  2202.             }
  2203.             $this->plainPassword $plainPassword;
  2204.             return $this;
  2205.         }
  2206.         public function getFirstName(): ?string
  2207.         {
  2208.             return $this->firstName;
  2209.         }
  2210.         public function setFirstName(?string $firstName): User
  2211.         {
  2212.             $this->firstName $firstName;
  2213.             return $this;
  2214.         }
  2215.         public function getLastName(): ?string
  2216.         {
  2217.             return $this->lastName;
  2218.         }
  2219.         public function setLastName(?string $lastName): User
  2220.         {
  2221.             $this->lastName $lastName;
  2222.             return $this;
  2223.         }
  2224.         public function getMobile(): ?string
  2225.         {
  2226.             $mobile str_replace(['-''/''.'' '], '-'$this->mobile);
  2227.             $re     '/^(?:(?:(?:\+|00)33[ ]?(?:\(0\)[ ]?)?)|0){1}[1-9]{1}([ .-]?)(?:\d{2}\1?){3}\d{2}$/m';
  2228.             preg_match_all($re'0'.$mobile$matchesPREG_SET_ORDER);
  2229.             if (!empty($matches)) {
  2230.                 $mobile '0'.$mobile;
  2231.             }
  2232.             return $mobile;
  2233.         }
  2234.         public function setMobile(?string $mobile): User
  2235.         {
  2236.             $this->mobile $mobile;
  2237.             return $this;
  2238.         }
  2239.         public function getPhone(): ?string
  2240.         {
  2241.             $phone str_replace(['-''/''.'' '], '-'$this->phone);
  2242.             $re    '/^(?:(?:(?:\+|00)33[ ]?(?:\(0\)[ ]?)?)|0){1}[1-9]{1}([ .-]?)(?:\d{2}\1?){3}\d{2}$/m';
  2243.             preg_match_all($re'0'.$phone$matchesPREG_SET_ORDER);
  2244.             if (!empty($matches)) {
  2245.                 $phone '0'.$phone;
  2246.             }
  2247.             return $phone;
  2248.         }
  2249.         public function setPhone(?string $phone): User
  2250.         {
  2251.             $this->phone $phone;
  2252.             return $this;
  2253.         }
  2254.         /**
  2255.          * @return int|null
  2256.          * @deprecated
  2257.          */
  2258.         public function getAvailablePoint(): ?int
  2259.         {
  2260.             return $this->availablePoint;
  2261.         }
  2262.         /**
  2263.          * @param   int  $availablePoint
  2264.          *
  2265.          * @return $this
  2266.          * @deprecated
  2267.          */
  2268.         public function setAvailablePoint(int $availablePoint): User
  2269.         {
  2270.             $this->availablePoint $availablePoint;
  2271.             return $this;
  2272.         }
  2273.         /**
  2274.          * @return int|null
  2275.          * @deprecated
  2276.          */
  2277.         public function getPotentialPoint(): ?int
  2278.         {
  2279.             return $this->potentialPoint;
  2280.         }
  2281.         /**
  2282.          * @param   int  $potentialPoint
  2283.          *
  2284.          * @return $this
  2285.          * @deprecated
  2286.          */
  2287.         public function setPotentialPoint(int $potentialPoint): User
  2288.         {
  2289.             $this->potentialPoint $potentialPoint;
  2290.             return $this;
  2291.         }
  2292.         /**
  2293.          * @return string|null
  2294.          * @deprecated
  2295.          */
  2296.         public function getLocale(): ?string
  2297.         {
  2298.             return $this->locale;
  2299.         }
  2300.         /**
  2301.          * @param   string|null  $locale
  2302.          *
  2303.          * @return $this
  2304.          * @deprecated
  2305.          */
  2306.         public function setLocale(?string $locale): User
  2307.         {
  2308.             $this->locale $locale;
  2309.             return $this;
  2310.         }
  2311.         public function getCountry(): ?string
  2312.         {
  2313.             return $this->country;
  2314.         }
  2315.         public function setCountry(?string $country): User
  2316.         {
  2317.             $this->country $country;
  2318.             return $this;
  2319.         }
  2320.         public function getJob(): ?string
  2321.         {
  2322.             if ($this->job === '') {
  2323.                 return NULL;
  2324.             }
  2325.             return $this->job;
  2326.         }
  2327.         public function setJob(?string $job): User
  2328.         {
  2329.             $this->job $job;
  2330.             return $this;
  2331.         }
  2332.         public function getCompany(): ?string
  2333.         {
  2334.             return $this->company;
  2335.         }
  2336.         public function setCompany(?string $company): User
  2337.         {
  2338.             $this->company $company;
  2339.             return $this;
  2340.         }
  2341.         /**
  2342.          * @deprecated
  2343.          */
  2344.         public function getUserToken(): ?string
  2345.         {
  2346.             return $this->userToken;
  2347.         }
  2348.         /**
  2349.          * @deprecated
  2350.          */
  2351.         public function setUserToken(?string $userToken): User
  2352.         {
  2353.             $this->userToken $userToken;
  2354.             return $this;
  2355.         }
  2356.         /**
  2357.          * @deprecated
  2358.          */
  2359.         public function getUserTokenValidity(): ?DateTimeInterface
  2360.         {
  2361.             return $this->userTokenValidity;
  2362.         }
  2363.         /**
  2364.          * @deprecated
  2365.          */
  2366.         public function setUserTokenValidity(?DateTimeInterface $userTokenValidity): User
  2367.         {
  2368.             $this->userTokenValidity $userTokenValidity;
  2369.             return $this;
  2370.         }
  2371.         /**
  2372.          * @deprecated
  2373.          */
  2374.         public function getUserTokenAttempts(): ?int
  2375.         {
  2376.             return $this->userTokenAttempts;
  2377.         }
  2378.         /**
  2379.          * @deprecated
  2380.          */
  2381.         public function setUserTokenAttempts(int $userTokenAttempts): User
  2382.         {
  2383.             $this->userTokenAttempts $userTokenAttempts;
  2384.             return $this;
  2385.         }
  2386.         public function getAddress1(): ?string
  2387.         {
  2388.             return $this->address1;
  2389.         }
  2390.         public function setAddress1(?string $address1): User
  2391.         {
  2392.             $this->address1 $address1;
  2393.             return $this;
  2394.         }
  2395.         public function getAddress2(): ?string
  2396.         {
  2397.             return $this->address2;
  2398.         }
  2399.         public function setAddress2(?string $address2): User
  2400.         {
  2401.             $this->address2 $address2;
  2402.             return $this;
  2403.         }
  2404.         public function getCity(): ?string
  2405.         {
  2406.             return $this->city;
  2407.         }
  2408.         public function setCity(?string $city): User
  2409.         {
  2410.             $this->city $city;
  2411.             return $this;
  2412.         }
  2413.         public function getCanOrder(): ?bool
  2414.         {
  2415.             return $this->canOrder;
  2416.         }
  2417.         public function setCanOrder(?bool $canOrder): User
  2418.         {
  2419.             $this->canOrder $canOrder;
  2420.             return $this;
  2421.         }
  2422.         public function getDeletedAt(): ?DateTimeInterface
  2423.         {
  2424.             return $this->deletedAt;
  2425.         }
  2426.         public function setDeletedAt(?DateTimeInterface $deletedAt): User
  2427.         {
  2428.             $this->deletedAt $deletedAt;
  2429.             return $this;
  2430.         }
  2431.         /**
  2432.          * @Serializer\VirtualProperty()
  2433.          * @SerializedName ("birthDate")
  2434.          * @Groups({"user:list", "user:item", "user", "get:read", "post:read", "export_user_datatable"})
  2435.          *
  2436.          *
  2437.          * @return DateTimeInterface|null
  2438.          */
  2439.         public function getBirthDate(): ?DateTimeInterface
  2440.         {
  2441.             try {
  2442.                 return new DateTime($this->getExtensionBySlug(\App\Constants\UserExtension::BIRTH_DATE));
  2443.             } catch (Exception $e) {
  2444.                 return NULL;
  2445.             }
  2446.         }
  2447.         /**
  2448.          * @throws Exception
  2449.          */
  2450.         public function setBirthDate($value): User
  2451.         {
  2452.             if ($value === NULL) {
  2453.                 return $this;
  2454.             }
  2455.             if ($value instanceof DateTimeInterface) {
  2456.                 $value $value->format('Y-m-d');
  2457.             }
  2458.             $this->addExtension(UserExtensionFactory::setBirthDate($this$value));
  2459.             return $this;
  2460.         }
  2461.         public function getBirthCity(): ?string
  2462.         {
  2463.             return $this->getExtensionBySlug(\App\Constants\UserExtension::BIRTH_CITY);
  2464.         }
  2465.         public function setBirthCity(?string $value): User
  2466.         {
  2467.             if ($value === NULL) {
  2468.                 return $this;
  2469.             }
  2470.             $this->addExtension(UserExtensionFactory::setBirthCity($this$value));
  2471.             return $this;
  2472.         }
  2473.         public function getSocialSecurityNumber(): ?string
  2474.         {
  2475.             return $this->getExtensionBySlug(\App\Constants\UserExtension::SOCIAL_SECURITY_NUMBER);
  2476.         }
  2477.         public function setSocialSecurityNumber(?string $value): User
  2478.         {
  2479.             if ($value === NULL) {
  2480.                 return $this;
  2481.             }
  2482.             $this->addExtension(UserExtensionFactory::setSocialSecurityNbr($this$value));
  2483.             return $this;
  2484.         }
  2485.         public function getInternalCode(): ?string
  2486.         {
  2487.             return $this->internalCode;
  2488.         }
  2489.         public function setInternalCode(?string $internalCode): User
  2490.         {
  2491.             $this->internalCode $internalCode;
  2492.             return $this;
  2493.         }
  2494.         public function getCguAt(): ?DateTimeInterface
  2495.         {
  2496.             return $this->cguAt;
  2497.         }
  2498.         public function setCguAt(?DateTimeInterface $cguAt): User
  2499.         {
  2500.             $this->cguAt $cguAt;
  2501.             return $this;
  2502.         }
  2503.         public function getImportedAt(): ?DateTimeInterface
  2504.         {
  2505.             return $this->importedAt;
  2506.         }
  2507.         public function setImportedAt(?DateTimeInterface $importedAt): User
  2508.         {
  2509.             $this->importedAt $importedAt;
  2510.             return $this;
  2511.         }
  2512.         public function getCanBeContacted(): ?bool
  2513.         {
  2514.             return $this->canBeContacted;
  2515.         }
  2516.         public function setCanBeContacted(bool $canBeContacted): User
  2517.         {
  2518.             $this->canBeContacted $canBeContacted;
  2519.             return $this;
  2520.         }
  2521.         /**
  2522.          * @deprecated
  2523.          */
  2524.         public function getCapacity(): ?string
  2525.         {
  2526.             return $this->capacity;
  2527.         }
  2528.         /**
  2529.          * @deprecated
  2530.          */
  2531.         public function setCapacity(?string $capacity): User
  2532.         {
  2533.             $this->capacity $capacity;
  2534.             return $this;
  2535.         }
  2536.         public function getAddress3(): ?string
  2537.         {
  2538.             return $this->address3;
  2539.         }
  2540.         public function setAddress3(?string $address3): User
  2541.         {
  2542.             $this->address3 $address3;
  2543.             return $this;
  2544.         }
  2545.         public function getOptinMail(): ?bool
  2546.         {
  2547.             return $this->optinMail;
  2548.         }
  2549.         public function setOptinMail(bool $optinMail): User
  2550.         {
  2551.             $this->optinMail $optinMail;
  2552.             return $this;
  2553.         }
  2554.         public function getOptinSMS(): ?bool
  2555.         {
  2556.             return $this->optinSMS;
  2557.         }
  2558.         public function setOptinSMS(bool $optinSMS): User
  2559.         {
  2560.             $this->optinSMS $optinSMS;
  2561.             return $this;
  2562.         }
  2563.         public function getOptinPostal(): ?bool
  2564.         {
  2565.             return $this->optinPostal;
  2566.         }
  2567.         public function setOptinPostal(bool $optinPostal): User
  2568.         {
  2569.             $this->optinPostal $optinPostal;
  2570.             return $this;
  2571.         }
  2572.         public function getOptinPostalAddress(): ?string
  2573.         {
  2574.             return $this->optinPostalAddress;
  2575.         }
  2576.         public function setOptinPostalAddress(?string $optinPostalAddress): User
  2577.         {
  2578.             $this->optinPostalAddress $optinPostalAddress;
  2579.             return $this;
  2580.         }
  2581.         public function getSource(): ?string
  2582.         {
  2583.             return $this->source;
  2584.         }
  2585.         public function setSource(?string $source): User
  2586.         {
  2587.             $this->source $source;
  2588.             return $this;
  2589.         }
  2590.         /**
  2591.          * @return int|null
  2592.          * @deprecated {@see UserPointService::getLevel()}
  2593.          */
  2594.         public function getLevel(): ?int
  2595.         {
  2596.             return $this->level;
  2597.         }
  2598.         /**
  2599.          * @param   int  $level
  2600.          *
  2601.          * @return $this
  2602.          * @deprecated
  2603.          */
  2604.         public function setLevel(int $level): User
  2605.         {
  2606.             $this->level $level;
  2607.             return $this;
  2608.         }
  2609.         /**
  2610.          * @return DateTimeInterface|null
  2611.          * @deprecated
  2612.          */
  2613.         public function getLevel0UpdatedAt(): ?DateTimeInterface
  2614.         {
  2615.             return $this->level0UpdatedAt;
  2616.         }
  2617.         /**
  2618.          * @param   DateTimeInterface|null  $level0UpdatedAt
  2619.          *
  2620.          * @return $this
  2621.          * @deprecated
  2622.          */
  2623.         public function setLevel0UpdatedAt(?DateTimeInterface $level0UpdatedAt): User
  2624.         {
  2625.             $this->level0UpdatedAt $level0UpdatedAt;
  2626.             return $this;
  2627.         }
  2628.         public function getLevel3UpdatedAt(): ?DateTimeInterface
  2629.         {
  2630.             return $this->level3UpdatedAt;
  2631.         }
  2632.         /**
  2633.          * @param   DateTimeInterface|null  $level3UpdatedAt
  2634.          *
  2635.          * @return $this
  2636.          * @deprecated
  2637.          */
  2638.         public function setLevel3UpdatedAt(?DateTimeInterface $level3UpdatedAt): User
  2639.         {
  2640.             $this->level3UpdatedAt $level3UpdatedAt;
  2641.             return $this;
  2642.         }
  2643.         /**
  2644.          * @return DateTimeInterface|null
  2645.          * @deprecated
  2646.          */
  2647.         public function getLevelUpdateSeenAt(): ?DateTimeInterface
  2648.         {
  2649.             return $this->levelUpdateSeenAt;
  2650.         }
  2651.         /**
  2652.          * @param   DateTimeInterface|null  $levelUpdateSeenAt
  2653.          *
  2654.          * @return $this
  2655.          * @deprecated
  2656.          */
  2657.         public function setLevelUpdateSeenAt(?DateTimeInterface $levelUpdateSeenAt): User
  2658.         {
  2659.             $this->levelUpdateSeenAt $levelUpdateSeenAt;
  2660.             return $this;
  2661.         }
  2662.         /**
  2663.          * @return bool|null
  2664.          * @deprecated
  2665.          */
  2666.         public function getIsEmailOk(): ?bool
  2667.         {
  2668.             return $this->isEmailOk;
  2669.         }
  2670.         /**
  2671.          * @param   bool  $isEmailOk
  2672.          *
  2673.          * @return $this
  2674.          * @deprecated
  2675.          */
  2676.         public function setIsEmailOk(bool $isEmailOk): User
  2677.         {
  2678.             $this->isEmailOk $isEmailOk;
  2679.             return $this;
  2680.         }
  2681.         /**
  2682.          * @return DateTimeInterface|null
  2683.          * @deprecated
  2684.          */
  2685.         public function getLastEmailCheck(): ?DateTimeInterface
  2686.         {
  2687.             return $this->lastEmailCheck;
  2688.         }
  2689.         /**
  2690.          * @param   DateTimeInterface|null  $lastEmailCheck
  2691.          *
  2692.          * @return $this
  2693.          * @deprecated
  2694.          */
  2695.         public function setLastEmailCheck(?DateTimeInterface $lastEmailCheck): User
  2696.         {
  2697.             $this->lastEmailCheck $lastEmailCheck;
  2698.             return $this;
  2699.         }
  2700.         /**
  2701.          * @return string|null
  2702.          * @deprecated
  2703.          */
  2704.         public function getApiToken(): ?string
  2705.         {
  2706.             return $this->apiToken;
  2707.         }
  2708.         /**
  2709.          * @param   string|null  $apiToken
  2710.          *
  2711.          * @return $this
  2712.          * @deprecated
  2713.          */
  2714.         public function setApiToken(?string $apiToken): User
  2715.         {
  2716.             $this->apiToken $apiToken;
  2717.             return $this;
  2718.         }
  2719.         public function getSapDistributor(): ?string
  2720.         {
  2721.             return $this->sapDistributor;
  2722.         }
  2723.         public function setSapDistributor(?string $sapDistributor): User
  2724.         {
  2725.             $this->sapDistributor $sapDistributor;
  2726.             return $this;
  2727.         }
  2728.         public function getDistributor(): ?string
  2729.         {
  2730.             return $this->distributor;
  2731.         }
  2732.         public function setDistributor(?string $distributor): User
  2733.         {
  2734.             $this->distributor $distributor;
  2735.             return $this;
  2736.         }
  2737.         public function getDistributor2(): ?string
  2738.         {
  2739.             return $this->distributor2;
  2740.         }
  2741.         public function setDistributor2(?string $distributor2): User
  2742.         {
  2743.             $this->distributor2 $distributor2;
  2744.             return $this;
  2745.         }
  2746.         public function getAggreement(): ?bool
  2747.         {
  2748.             return $this->aggreement;
  2749.         }
  2750.         public function setAggreement(?bool $aggreement): User
  2751.         {
  2752.             $this->aggreement $aggreement;
  2753.             return $this;
  2754.         }
  2755.         public function getUnsubscribedAt(): ?DateTimeInterface
  2756.         {
  2757.             return $this->unsubscribedAt;
  2758.         }
  2759.         public function setUnsubscribedAt(?DateTimeInterface $unsubscribedAt): User
  2760.         {
  2761.             $this->unsubscribedAt $unsubscribedAt;
  2762.             return $this;
  2763.         }
  2764.         public function addAddress(Address $address): User
  2765.         {
  2766.             if (!$this->addresses->contains($address)) {
  2767.                 $this->addresses[] = $address;
  2768.                 $address->setUser($this);
  2769.             }
  2770.             return $this;
  2771.         }
  2772.         public function removeAddress(Address $address): User
  2773.         {
  2774.             if ($this->addresses->removeElement($address)) {
  2775.                 // set the owning side to null (unless already changed)
  2776.                 if ($address->getUser() === $this) {
  2777.                     $address->setUser(NULL);
  2778.                 }
  2779.             }
  2780.             return $this;
  2781.         }
  2782.         public function getCarts(): Collection
  2783.         {
  2784.             return $this->carts;
  2785.         }
  2786.         public function addCart(Cart $cart): User
  2787.         {
  2788.             if (!$this->carts->contains($cart)) {
  2789.                 $this->carts[] = $cart;
  2790.                 $cart->setUser($this);
  2791.             }
  2792.             return $this;
  2793.         }
  2794.         public function removeCart(Cart $cart): User
  2795.         {
  2796.             if ($this->carts->removeElement($cart)) {
  2797.                 // set the owning side to null (unless already changed)
  2798.                 if ($cart->getUser() === $this) {
  2799.                     $cart->setUser(NULL);
  2800.                 }
  2801.             }
  2802.             return $this;
  2803.         }
  2804.         public function getSapAccount(): ?string
  2805.         {
  2806.             return $this->sapAccount;
  2807.         }
  2808.         public function setSapAccount(?string $sapAccount): User
  2809.         {
  2810.             $this->sapAccount $sapAccount;
  2811.             return $this;
  2812.         }
  2813.         public function getMainAccountUser(): ?User
  2814.         {
  2815.             return $this->mainAccountUser;
  2816.         }
  2817.         public function setMainAccountUser(?User $mainAccountUser): User
  2818.         {
  2819.             $this->mainAccountUser $mainAccountUser;
  2820.             return $this;
  2821.         }
  2822.         public function getDistributors(): Collection
  2823.         {
  2824.             return $this->distributors;
  2825.         }
  2826.         public function addDistributor(Distributor $distributor): User
  2827.         {
  2828.             if (!$this->distributors->contains($distributor)) {
  2829.                 $this->distributors[] = $distributor;
  2830.             }
  2831.             return $this;
  2832.         }
  2833.         public function removeDistributor(Distributor $distributor): User
  2834.         {
  2835.             $this->distributors->removeElement($distributor);
  2836.             return $this;
  2837.         }
  2838.         public function getPurchases(): Collection
  2839.         {
  2840.             return $this->purchases;
  2841.         }
  2842.         public function addPurchase(Purchase $purchase): User
  2843.         {
  2844.             if (!$this->purchases->contains($purchase)) {
  2845.                 $this->purchases[] = $purchase;
  2846.                 $purchase->setValidator($this);
  2847.             }
  2848.             return $this;
  2849.         }
  2850.         public function removePurchase(Purchase $purchase): User
  2851.         {
  2852.             if ($this->purchases->removeElement($purchase)) {
  2853.                 // set the owning side to null (unless already changed)
  2854.                 if ($purchase->getValidator() === $this) {
  2855.                     $purchase->setValidator(NULL);
  2856.                 }
  2857.             }
  2858.             return $this;
  2859.         }
  2860.         public function getPurchasesIHaveProcessed(): Collection
  2861.         {
  2862.             return $this->purchasesIHaveProcessed;
  2863.         }
  2864.         public function addPurchaseIHaveProcessed(Purchase $purchasesIHaveProcessed): User
  2865.         {
  2866.             if (!$this->purchasesIHaveProcessed->contains($purchasesIHaveProcessed)) {
  2867.                 $this->purchasesIHaveProcessed[] = $purchasesIHaveProcessed;
  2868.                 $purchasesIHaveProcessed->setValidator($this);
  2869.             }
  2870.             return $this;
  2871.         }
  2872.         public function removePurchaseIHaveProcessed(Purchase $purchasesIHaveProcessed): User
  2873.         {
  2874.             if ($this->purchasesIHaveProcessed->removeElement($purchasesIHaveProcessed)) {
  2875.                 // set the owning side to null (unless already changed)
  2876.                 if ($purchasesIHaveProcessed->getValidator() === $this) {
  2877.                     $purchasesIHaveProcessed->setValidator(NULL);
  2878.                 }
  2879.             }
  2880.             return $this;
  2881.         }
  2882.         public function getOrders(): Collection
  2883.         {
  2884.             return $this->orders;
  2885.         }
  2886.         public function addOrder(SaleOrder $order): User
  2887.         {
  2888.             if (!$this->orders->contains($order)) {
  2889.                 $this->orders[] = $order;
  2890.                 $order->setUser($this);
  2891.             }
  2892.             return $this;
  2893.         }
  2894.         public function removeOrder(SaleOrder $order): User
  2895.         {
  2896.             if ($this->orders->removeElement($order)) {
  2897.                 // set the owning side to null (unless already changed)
  2898.                 if ($order->getUser() === $this) {
  2899.                     $order->setUser(NULL);
  2900.                 }
  2901.             }
  2902.             return $this;
  2903.         }
  2904.         public function getGodchilds(): Collection
  2905.         {
  2906.             return $this->godchilds;
  2907.         }
  2908.         public function addGodchild(GodChild $godchild): User
  2909.         {
  2910.             if (!$this->godchilds->contains($godchild)) {
  2911.                 $this->godchilds[] = $godchild;
  2912.                 $godchild->setUser($this);
  2913.             }
  2914.             return $this;
  2915.         }
  2916.         public function removeGodchild(GodChild $godchild): User
  2917.         {
  2918.             if ($this->godchilds->removeElement($godchild)) {
  2919.                 // set the owning side to null (unless already changed)
  2920.                 if ($godchild->getUser() === $this) {
  2921.                     $godchild->setUser(NULL);
  2922.                 }
  2923.             }
  2924.             return $this;
  2925.         }
  2926.         /**
  2927.          * @deprecated
  2928.          */
  2929.         public function getSatisfactions(): Collection
  2930.         {
  2931.             return $this->satisfactions;
  2932.         }
  2933.         /**
  2934.          * @deprecated
  2935.          */
  2936.         public function addSatisfaction(Satisfaction $satisfaction): User
  2937.         {
  2938.             if (!$this->satisfactions->contains($satisfaction)) {
  2939.                 $this->satisfactions[] = $satisfaction;
  2940.                 $satisfaction->setUser($this);
  2941.             }
  2942.             return $this;
  2943.         }
  2944.         /**
  2945.          * @deprecated
  2946.          */
  2947.         public function removeSatisfaction(Satisfaction $satisfaction): User
  2948.         {
  2949.             if ($this->satisfactions->removeElement($satisfaction)) {
  2950.                 // set the owning side to null (unless already changed)
  2951.                 if ($satisfaction->getUser() === $this) {
  2952.                     $satisfaction->setUser(NULL);
  2953.                 }
  2954.             }
  2955.             return $this;
  2956.         }
  2957.         public function getRequestProductAvailables(): Collection
  2958.         {
  2959.             return $this->requestProductAvailables;
  2960.         }
  2961.         public function addRequestProductAvailable(RequestProductAvailable $requestProductAvailable): User
  2962.         {
  2963.             if (!$this->requestProductAvailables->contains($requestProductAvailable)) {
  2964.                 $this->requestProductAvailables[] = $requestProductAvailable;
  2965.                 $requestProductAvailable->setUser($this);
  2966.             }
  2967.             return $this;
  2968.         }
  2969.         public function removeRequestProductAvailable(RequestProductAvailable $requestProductAvailable): User
  2970.         {
  2971.             if ($this->requestProductAvailables->removeElement($requestProductAvailable)) {
  2972.                 // set the owning side to null (unless already changed)
  2973.                 if ($requestProductAvailable->getUser() === $this) {
  2974.                     $requestProductAvailable->setUser(NULL);
  2975.                 }
  2976.             }
  2977.             return $this;
  2978.         }
  2979.         public function getUserImportHistories(): Collection
  2980.         {
  2981.             return $this->userImportHistories;
  2982.         }
  2983.         public function addUserImportHistory(UserImportHistory $userImportHistory): User
  2984.         {
  2985.             if (!$this->userImportHistories->contains($userImportHistory)) {
  2986.                 $this->userImportHistories[] = $userImportHistory;
  2987.                 $userImportHistory->setImporter($this);
  2988.             }
  2989.             return $this;
  2990.         }
  2991.         public function removeUserImportHistory(UserImportHistory $userImportHistory): User
  2992.         {
  2993.             if ($this->userImportHistories->removeElement($userImportHistory)) {
  2994.                 // set the owning side to null (unless already changed)
  2995.                 if ($userImportHistory->getImporter() === $this) {
  2996.                     $userImportHistory->setImporter(NULL);
  2997.                 }
  2998.             }
  2999.             return $this;
  3000.         }
  3001.         public function getContactLists(): Collection
  3002.         {
  3003.             return $this->contactLists;
  3004.         }
  3005.         public function addContactList(ContactList $contactList): User
  3006.         {
  3007.             if (!$this->contactLists->contains($contactList)) {
  3008.                 $this->contactLists[] = $contactList;
  3009.                 $contactList->addUser($this);
  3010.             }
  3011.             return $this;
  3012.         }
  3013.         public function removeContactList(ContactList $contactList): User
  3014.         {
  3015.             if ($this->contactLists->removeElement($contactList)) {
  3016.                 $contactList->removeUser($this);
  3017.             }
  3018.             return $this;
  3019.         }
  3020.         /**
  3021.          * @deprecated
  3022.          */
  3023.         public function getUsernameCanonical(): ?string
  3024.         {
  3025.             return $this->usernameCanonical;
  3026.         }
  3027.         /**
  3028.          * @deprecated
  3029.          */
  3030.         public function setUsernameCanonical(?string $usernameCanonical): User
  3031.         {
  3032.             $this->usernameCanonical $usernameCanonical;
  3033.             return $this;
  3034.         }
  3035.         /**
  3036.          * @deprecated
  3037.          */
  3038.         public function getEmailCanonical(): ?string
  3039.         {
  3040.             return $this->emailCanonical;
  3041.         }
  3042.         /**
  3043.          * @deprecated
  3044.          */
  3045.         public function setEmailCanonical(?string $emailCanonical): User
  3046.         {
  3047.             $this->emailCanonical $emailCanonical;
  3048.             return $this;
  3049.         }
  3050.         public function getLastLogin(): ?DateTimeInterface
  3051.         {
  3052.             return $this->lastLogin;
  3053.         }
  3054.         public function setLastLogin(?DateTimeInterface $lastLogin): User
  3055.         {
  3056.             $this->lastLogin $lastLogin;
  3057.             return $this;
  3058.         }
  3059.         public function getConfirmationToken(): ?string
  3060.         {
  3061.             return $this->confirmationToken;
  3062.         }
  3063.         public function setConfirmationToken(?string $confirmationToken): User
  3064.         {
  3065.             $this->confirmationToken $confirmationToken;
  3066.             return $this;
  3067.         }
  3068.         public function getPasswordRequestedAt(): ?DateTimeInterface
  3069.         {
  3070.             return $this->passwordRequestedAt;
  3071.         }
  3072.         public function setPasswordRequestedAt(?DateTimeInterface $passwordRequestedAt): User
  3073.         {
  3074.             $this->passwordRequestedAt $passwordRequestedAt;
  3075.             return $this;
  3076.         }
  3077.         public function getCredentialExpired(): ?bool
  3078.         {
  3079.             return $this->credentialExpired;
  3080.         }
  3081.         public function setCredentialExpired(?bool $credentialExpired): User
  3082.         {
  3083.             $this->credentialExpired $credentialExpired;
  3084.             return $this;
  3085.         }
  3086.         public function getCredentialExpiredAt(): ?DateTimeInterface
  3087.         {
  3088.             return $this->credentialExpiredAt;
  3089.         }
  3090.         public function setCredentialExpiredAt(?DateTimeInterface $credentialExpiredAt): User
  3091.         {
  3092.             $this->credentialExpiredAt $credentialExpiredAt;
  3093.             return $this;
  3094.         }
  3095.         public function getDevis(): Collection
  3096.         {
  3097.             return $this->devis;
  3098.         }
  3099.         public function addDevi(Devis $devi): User
  3100.         {
  3101.             if (!$this->devis->contains($devi)) {
  3102.                 $this->devis[] = $devi;
  3103.                 $devi->setUser($this);
  3104.             }
  3105.             return $this;
  3106.         }
  3107.         public function removeDevi(Devis $devi): User
  3108.         {
  3109.             if ($this->devis->removeElement($devi)) {
  3110.                 // set the owning side to null (unless already changed)
  3111.                 if ($devi->getUser() === $this) {
  3112.                     $devi->setUser(NULL);
  3113.                 }
  3114.             }
  3115.             return $this;
  3116.         }
  3117.         public function __call($name$arguments)
  3118.         {
  3119.             // TODO: Implement @method string getUserIdentifier()
  3120.         }
  3121.         public function getRegate(): ?Regate
  3122.         {
  3123.             return $this->regate;
  3124.         }
  3125.         public function setRegate(?Regate $regate): User
  3126.         {
  3127.             $this->regate $regate;
  3128.             return $this;
  3129.         }
  3130.         public function getDonneesPersonnelles(): ?bool
  3131.         {
  3132.             return $this->donneesPersonnelles;
  3133.         }
  3134.         public function setDonneesPersonnelles(?bool $donneesPersonnelles): User
  3135.         {
  3136.             $this->donneesPersonnelles $donneesPersonnelles;
  3137.             return $this;
  3138.         }
  3139.         /**
  3140.          * @return Collection|PointTransaction[]
  3141.          */
  3142.         public function getPointTransactions(): Collection
  3143.         {
  3144.             return $this->pointTransactions;
  3145.         }
  3146.         public function addPointTransaction(PointTransaction $pointTransaction): User
  3147.         {
  3148.             if (!$this->pointTransactions->contains($pointTransaction)) {
  3149.                 $this->pointTransactions[] = $pointTransaction;
  3150.                 $pointTransaction->setUser($this);
  3151.             }
  3152.             return $this;
  3153.         }
  3154.         public function removePointTransaction(PointTransaction $pointTransaction): User
  3155.         {
  3156.             if ($this->pointTransactions->removeElement($pointTransaction)) {
  3157.                 // set the owning side to null (unless already changed)
  3158.                 if ($pointTransaction->getUser() === $this) {
  3159.                     $pointTransaction->setUser(NULL);
  3160.                 }
  3161.             }
  3162.             return $this;
  3163.         }
  3164.         /**
  3165.          * @return Collection|User[]
  3166.          */
  3167.         public function getInstallers(): Collection
  3168.         {
  3169.             return $this->installers;
  3170.         }
  3171.         public function addInstaller(User $installer): User
  3172.         {
  3173.             if (!$this->installers->contains($installer)) {
  3174.                 $this->installers[] = $installer;
  3175.                 $installer->setCommercial($this);
  3176.             }
  3177.             return $this;
  3178.         }
  3179.         public function removeInstaller(User $installer): User
  3180.         {
  3181.             if ($this->installers->removeElement($installer)) {
  3182.                 // set the owning side to null (unless already changed)
  3183.                 if ($installer->getCommercial() === $this) {
  3184.                     $installer->setCommercial(NULL);
  3185.                 }
  3186.             }
  3187.             return $this;
  3188.         }
  3189.         public function getCommercial(): ?User
  3190.         {
  3191.             return $this->commercial;
  3192.         }
  3193.         public function setCommercial(?User $commercial): User
  3194.         {
  3195.             $this->commercial $commercial;
  3196.             return $this;
  3197.         }
  3198.         /**
  3199.          * @return Collection|User[]
  3200.          */
  3201.         public function getHeatingInstallers(): Collection
  3202.         {
  3203.             return $this->heatingInstallers;
  3204.         }
  3205.         public function addHeatingInstaller(User $heatingInstaller): User
  3206.         {
  3207.             if (!$this->heatingInstallers->contains($heatingInstaller)) {
  3208.                 $this->heatingInstallers[] = $heatingInstaller;
  3209.                 $heatingInstaller->setHeatingCommercial($this);
  3210.             }
  3211.             return $this;
  3212.         }
  3213.         public function removeHeatingInstaller(User $heatingInstaller): User
  3214.         {
  3215.             if ($this->heatingInstallers->removeElement($heatingInstaller)) {
  3216.                 // set the owning side to null (unless already changed)
  3217.                 if ($heatingInstaller->getHeatingCommercial() === $this) {
  3218.                     $heatingInstaller->setHeatingCommercial(NULL);
  3219.                 }
  3220.             }
  3221.             return $this;
  3222.         }
  3223.         public function getHeatingCommercial(): ?User
  3224.         {
  3225.             return $this->heatingCommercial;
  3226.         }
  3227.         public function setHeatingCommercial(?User $heatingCommercial): User
  3228.         {
  3229.             $this->heatingCommercial $heatingCommercial;
  3230.             return $this;
  3231.         }
  3232.         public function getAgency(): ?Agence
  3233.         {
  3234.             return $this->agency;
  3235.         }
  3236.         public function setAgency(?Agence $agency): User
  3237.         {
  3238.             $this->agency $agency;
  3239.             return $this;
  3240.         }
  3241.         public function getArchivedAt(): ?DateTimeInterface
  3242.         {
  3243.             return $this->archivedAt;
  3244.         }
  3245.         public function setArchivedAt(?DateTimeInterface $archivedAt): User
  3246.         {
  3247.             $this->archivedAt $archivedAt;
  3248.             return $this;
  3249.         }
  3250.         public function getNewsletter(): ?bool
  3251.         {
  3252.             return $this->newsletter;
  3253.         }
  3254.         public function setNewsletter(bool $newsletter): User
  3255.         {
  3256.             $this->newsletter $newsletter;
  3257.             return $this;
  3258.         }
  3259.         public function getCompanySiret(): ?string
  3260.         {
  3261.             return $this->companySiret;
  3262.         }
  3263.         public function setCompanySiret(?string $companySiret): User
  3264.         {
  3265.             $this->companySiret $companySiret;
  3266.             return $this;
  3267.         }
  3268.         /**
  3269.          * @return Collection|UserBusinessResult[]
  3270.          */
  3271.         public function getUserBusinessResults(): Collection
  3272.         {
  3273.             return $this->userBusinessResults;
  3274.         }
  3275.         public function addUserBusinessResult(UserBusinessResult $userBusinessResult): User
  3276.         {
  3277.             if (!$this->userBusinessResults->contains($userBusinessResult)) {
  3278.                 $this->userBusinessResults[] = $userBusinessResult;
  3279.                 $userBusinessResult->setUser($this);
  3280.             }
  3281.             return $this;
  3282.         }
  3283.         public function removeUserBusinessResult(UserBusinessResult $userBusinessResult): User
  3284.         {
  3285.             if ($this->userBusinessResults->removeElement($userBusinessResult)) {
  3286.                 // set the owning side to null (unless already changed)
  3287.                 if ($userBusinessResult->getUser() === $this) {
  3288.                     $userBusinessResult->setUser(NULL);
  3289.                 }
  3290.             }
  3291.             return $this;
  3292.         }
  3293.         public function getExtension1(): ?string
  3294.         {
  3295.             return $this->extension1;
  3296.         }
  3297.         public function setExtension1(?string $extension1): User
  3298.         {
  3299.             $this->extension1 $extension1;
  3300.             return $this;
  3301.         }
  3302.         public function getExtension2(): ?string
  3303.         {
  3304.             return $this->extension2;
  3305.         }
  3306.         public function setExtension2(?string $extension2): User
  3307.         {
  3308.             $this->extension2 $extension2;
  3309.             return $this;
  3310.         }
  3311.         public function getWdg(): ?int
  3312.         {
  3313.             return $this->wdg;
  3314.         }
  3315.         public function setWdg(?int $wdg): User
  3316.         {
  3317.             $this->wdg $wdg;
  3318.             return $this;
  3319.         }
  3320.         public function getGladyUuid(): ?string
  3321.         {
  3322.             return $this->gladyUuid;
  3323.         }
  3324.         public function setGladyUuid(?string $gladyUuid): User
  3325.         {
  3326.             $this->gladyUuid $gladyUuid;
  3327.             return $this;
  3328.         }
  3329.         public function getCoverageArea(): ?CoverageArea
  3330.         {
  3331.             return $this->coverageArea;
  3332.         }
  3333.         public function setCoverageArea(?CoverageArea $coverageArea): User
  3334.         {
  3335.             $this->coverageArea $coverageArea;
  3336.             $coverageArea->setUser($this);
  3337.             return $this;
  3338.         }
  3339.         /**
  3340.          * @return Collection<int, Project>
  3341.          */
  3342.         public function getProjects(): Collection
  3343.         {
  3344.             return $this->projects;
  3345.         }
  3346.         public function addProject(Project $project): User
  3347.         {
  3348.             if (!$this->projects->contains($project)) {
  3349.                 $this->projects[] = $project;
  3350.                 $project->setReferent($this);
  3351.             }
  3352.             return $this;
  3353.         }
  3354.         public function removeProject(Project $project): User
  3355.         {
  3356.             if ($this->projects->removeElement($project)) {
  3357.                 // set the owning side to null (unless already changed)
  3358.                 if ($project->getReferent() === $this) {
  3359.                     $project->setReferent(NULL);
  3360.                 }
  3361.             }
  3362.             return $this;
  3363.         }
  3364.         public function getProgramme(): ?Programme
  3365.         {
  3366.             return $this->programme;
  3367.         }
  3368.         public function setProgramme(?Programme $programme): User
  3369.         {
  3370.             $this->programme $programme;
  3371.             return $this;
  3372.         }
  3373.         /**
  3374.          * @return Collection<int, ServiceUser>
  3375.          */
  3376.         public function getServiceUsers(): Collection
  3377.         {
  3378.             return $this->serviceUsers;
  3379.         }
  3380.         public function addServiceUser(ServiceUser $serviceUser): User
  3381.         {
  3382.             if (!$this->serviceUsers->contains($serviceUser)) {
  3383.                 $this->serviceUsers[] = $serviceUser;
  3384.                 $serviceUser->setUser($this);
  3385.             }
  3386.             return $this;
  3387.         }
  3388.         public function removeServiceUser(ServiceUser $serviceUser): User
  3389.         {
  3390.             if ($this->serviceUsers->removeElement($serviceUser)) {
  3391.                 // set the owning side to null (unless already changed)
  3392.                 if ($serviceUser->getUser() === $this) {
  3393.                     $serviceUser->setUser(NULL);
  3394.                 }
  3395.             }
  3396.             return $this;
  3397.         }
  3398.         public function getSaleOrderValidation(): ?SaleOrderValidation
  3399.         {
  3400.             return $this->saleOrderValidation;
  3401.         }
  3402.         public function setSaleOrderValidation(?SaleOrderValidation $saleOrderValidation): User
  3403.         {
  3404.             $this->saleOrderValidation $saleOrderValidation;
  3405.             return $this;
  3406.         }
  3407.         /**
  3408.          * @return Collection<int, Univers>
  3409.          */
  3410.         public function getUniverses(): Collection
  3411.         {
  3412.             return $this->universes;
  3413.         }
  3414.         public function addUnivers(Univers $univers): User
  3415.         {
  3416.             if (!$this->universes->contains($univers)) {
  3417.                 $this->universes[] = $univers;
  3418.                 $univers->addUser($this);
  3419.             }
  3420.             return $this;
  3421.         }
  3422.         public function removeUniverses(Univers $universes): User
  3423.         {
  3424.             if ($this->universes->removeElement($universes)) {
  3425.                 $universes->removeUser($this);
  3426.             }
  3427.             return $this;
  3428.         }
  3429.         public function getBillingPoint(): ?BillingPoint
  3430.         {
  3431.             return $this->billingPoint;
  3432.         }
  3433.         public function setBillingPoint(?BillingPoint $billingPoint): User
  3434.         {
  3435.             $this->billingPoint $billingPoint;
  3436.             return $this;
  3437.         }
  3438.         /**
  3439.          * @return Collection<int, Score>
  3440.          */
  3441.         public function getScores(): Collection
  3442.         {
  3443.             return $this->scores;
  3444.         }
  3445.         public function addScore(Score $score): User
  3446.         {
  3447.             if (!$this->scores->contains($score)) {
  3448.                 $this->scores[] = $score;
  3449.                 $score->setUser($this);
  3450.             }
  3451.             return $this;
  3452.         }
  3453.         public function removeScore(Score $score): User
  3454.         {
  3455.             if ($this->scores->removeElement($score)) {
  3456.                 // set the owning side to null (unless already changed)
  3457.                 if ($score->getUser() === $this) {
  3458.                     $score->setUser(NULL);
  3459.                 }
  3460.             }
  3461.             return $this;
  3462.         }
  3463.         /**
  3464.          * @return Collection<int, ScoreObjective>
  3465.          */
  3466.         public function getScoreObjectives(): Collection
  3467.         {
  3468.             return $this->scoreObjectives;
  3469.         }
  3470.         public function addScoreObjective(ScoreObjective $scoreObjective): User
  3471.         {
  3472.             if (!$this->scoreObjectives->contains($scoreObjective)) {
  3473.                 $this->scoreObjectives[] = $scoreObjective;
  3474.                 $scoreObjective->setUser($this);
  3475.             }
  3476.             return $this;
  3477.         }
  3478.         public function removeScoreObjective(ScoreObjective $scoreObjective): User
  3479.         {
  3480.             if ($this->scoreObjectives->removeElement($scoreObjective)) {
  3481.                 // set the owning side to null (unless already changed)
  3482.                 if ($scoreObjective->getUser() === $this) {
  3483.                     $scoreObjective->setUser(NULL);
  3484.                 }
  3485.             }
  3486.             return $this;
  3487.         }
  3488.         /**
  3489.          * @return Collection<int, User>
  3490.          */
  3491.         public function getChildren(): Collection
  3492.         {
  3493.             return $this->children;
  3494.         }
  3495.         /**
  3496.          * @param   User|null  $child
  3497.          *
  3498.          * @return $this
  3499.          */
  3500.         public function addChild(?User $child): User
  3501.         {
  3502.             if ($child && !$this->children->contains($child)) {
  3503.                 $this->children[] = $child;
  3504.                 $child->addParent($this);
  3505.             }
  3506.             return $this;
  3507.         }
  3508.         /**
  3509.          * @param   User|null  $parent
  3510.          *
  3511.          * @return $this
  3512.          */
  3513.         public function addParent(?User $parent): User
  3514.         {
  3515.             if ($parent && !$this->parents->contains($parent)) {
  3516.                 $this->parents[] = $parent;
  3517.                 $parent->addChild($this);
  3518.             }
  3519.             return $this;
  3520.         }
  3521.         /**
  3522.          * @return Collection<int, User>
  3523.          */
  3524.         public function getParents(): Collection
  3525.         {
  3526.             return $this->parents;
  3527.         }
  3528.         public function removeParent(User $parent): User
  3529.         {
  3530.             if ($this->parents->removeElement($parent)) {
  3531.                 $parent->removeChild($this);
  3532.                 $this->removeParent($parent);
  3533.             }
  3534.             return $this;
  3535.         }
  3536.         public function removeChild(User $child): User
  3537.         {
  3538.             $this->children->removeElement($child);
  3539.             return $this;
  3540.         }
  3541.         /**
  3542.          * @return Collection<int, Message>
  3543.          */
  3544.         public function getSenderMessages(): Collection
  3545.         {
  3546.             return $this->senderMessages;
  3547.         }
  3548.         public function addSenderMessage(Message $senderMessage): User
  3549.         {
  3550.             if (!$this->senderMessages->contains($senderMessage)) {
  3551.                 $this->senderMessages[] = $senderMessage;
  3552.                 $senderMessage->setSender($this);
  3553.             }
  3554.             return $this;
  3555.         }
  3556.         public function removeSenderMessage(Message $senderMessage): User
  3557.         {
  3558.             if ($this->senderMessages->removeElement($senderMessage)) {
  3559.                 // set the owning side to null (unless already changed)
  3560.                 if ($senderMessage->getSender() === $this) {
  3561.                     $senderMessage->setSender(NULL);
  3562.                 }
  3563.             }
  3564.             return $this;
  3565.         }
  3566.         /**
  3567.          * @return Collection<int, Message>
  3568.          */
  3569.         public function getReceiverMessages(): Collection
  3570.         {
  3571.             return $this->receiverMessages;
  3572.         }
  3573.         public function addReceiverMessage(Message $receiverMessage): User
  3574.         {
  3575.             if (!$this->receiverMessages->contains($receiverMessage)) {
  3576.                 $this->receiverMessages[] = $receiverMessage;
  3577.                 $receiverMessage->setReceiver($this);
  3578.             }
  3579.             return $this;
  3580.         }
  3581.         public function removeReceiverMessage(Message $receiverMessage): User
  3582.         {
  3583.             if ($this->receiverMessages->removeElement($receiverMessage)) {
  3584.                 // set the owning side to null (unless already changed)
  3585.                 if ($receiverMessage->getReceiver() === $this) {
  3586.                     $receiverMessage->setReceiver(NULL);
  3587.                 }
  3588.             }
  3589.             return $this;
  3590.         }
  3591.         public function getRequestRegistration(): ?RequestRegistration
  3592.         {
  3593.             return $this->requestRegistration;
  3594.         }
  3595.         public function setRequestRegistration(RequestRegistration $requestRegistration): User
  3596.         {
  3597.             // set the owning side of the relation if necessary
  3598.             if ($requestRegistration->getUser() !== $this) {
  3599.                 $requestRegistration->setUser($this);
  3600.             }
  3601.             $this->requestRegistration $requestRegistration;
  3602.             return $this;
  3603.         }
  3604.         /**
  3605.          * @return Collection<int, RequestRegistration>
  3606.          */
  3607.         public function getRequestRegistrationsToValidate(): Collection
  3608.         {
  3609.             return $this->requestRegistrationsToValidate;
  3610.         }
  3611.         public function addRequestRegistrationsToValidate(RequestRegistration $requestRegistrationsToValidate): User
  3612.         {
  3613.             if (!$this->requestRegistrationsToValidate->contains($requestRegistrationsToValidate)) {
  3614.                 $this->requestRegistrationsToValidate[] = $requestRegistrationsToValidate;
  3615.                 $requestRegistrationsToValidate->setReferent($this);
  3616.             }
  3617.             return $this;
  3618.         }
  3619.         public function removeRequestRegistrationsToValidate(RequestRegistration $requestRegistrationsToValidate): User
  3620.         {
  3621.             if ($this->requestRegistrationsToValidate->removeElement($requestRegistrationsToValidate)) {
  3622.                 // set the owning side to null (unless already changed)
  3623.                 if ($requestRegistrationsToValidate->getReferent() === $this) {
  3624.                     $requestRegistrationsToValidate->setReferent(NULL);
  3625.                 }
  3626.             }
  3627.             return $this;
  3628.         }
  3629.         /**
  3630.          * @return Collection<int, CustomProductOrder>
  3631.          */
  3632.         public function getCustomProductOrders(): Collection
  3633.         {
  3634.             return $this->customProductOrders;
  3635.         }
  3636.         public function addCustomProductOrder(CustomProductOrder $customProductOrder): User
  3637.         {
  3638.             if (!$this->customProductOrders->contains($customProductOrder)) {
  3639.                 $this->customProductOrders[] = $customProductOrder;
  3640.                 $customProductOrder->setUser($this);
  3641.             }
  3642.             return $this;
  3643.         }
  3644.         public function removeCustomProductOrder(CustomProductOrder $customProductOrder): User
  3645.         {
  3646.             if ($this->customProductOrders->removeElement($customProductOrder)) {
  3647.                 // set the owning side to null (unless already changed)
  3648.                 if ($customProductOrder->getUser() === $this) {
  3649.                     $customProductOrder->setUser(NULL);
  3650.                 }
  3651.             }
  3652.             return $this;
  3653.         }
  3654.         public function removeCustomProduct(CustomProduct $customProduct): User
  3655.         {
  3656.             if ($this->customProducts->removeElement($customProduct)) {
  3657.                 // set the owning side to null (unless already changed)
  3658.                 if ($customProduct->getCreatedBy() === $this) {
  3659.                     $customProduct->setCreatedBy(NULL);
  3660.                 }
  3661.             }
  3662.             return $this;
  3663.         }
  3664.         public function getSubscription()
  3665.         {
  3666.             return $this->subscription;
  3667.         }
  3668.         public function setSubscription(UserSubscription $subscription): User
  3669.         {
  3670.             // set the owning side of the relation if necessary
  3671.             if ($subscription->getUser() !== $this) {
  3672.                 $subscription->setUser($this);
  3673.             }
  3674.             $this->subscription $subscription;
  3675.             return $this;
  3676.         }
  3677.         /**
  3678.          * @return Collection<int, UserExtension>
  3679.          */
  3680.         public function getExtensions(): Collection
  3681.         {
  3682.             return $this->extensions;
  3683.         }
  3684.         public function addExtension(?UserExtension $extension): User
  3685.         {
  3686.             if ($extension !== NULL && !$this->extensions->contains($extension)) {
  3687.                 $this->extensions[] = $extension;
  3688.                 $extension->setUser($this);
  3689.             }
  3690.             return $this;
  3691.         }
  3692.         public function removeExtension(UserExtension $extension): User
  3693.         {
  3694.             if ($this->extensions->removeElement($extension)) {
  3695.                 // set the owning side to null (unless already changed)
  3696.                 if ($extension->getUser() === $this) {
  3697.                     $extension->setUser(NULL);
  3698.                 }
  3699.             }
  3700.             return $this;
  3701.         }
  3702.         /**
  3703.          * @return Collection<int, CustomProduct>
  3704.          */
  3705.         public function getCustomProducts(): Collection
  3706.         {
  3707.             return $this->customProducts;
  3708.         }
  3709.         public function addCustomProduct(CustomProduct $customProduct): User
  3710.         {
  3711.             if (!$this->customProducts->contains($customProduct)) {
  3712.                 $this->customProducts[] = $customProduct;
  3713.                 $customProduct->setCreatedBy($this);
  3714.             }
  3715.             return $this;
  3716.         }
  3717.         public function getStatus(): string
  3718.         {
  3719.             return $this->status;
  3720.         }
  3721.         public function setStatus(string $status): User
  3722.         {
  3723.             $this->status $status;
  3724.             return $this;
  3725.         }
  3726.         public function getCalculatedPoints(): ?string
  3727.         {
  3728.             return $this->calculatedPoints;
  3729.         }
  3730.         public function setCalculatedPoints(?string $calculatedPoints): User
  3731.         {
  3732.             $this->calculatedPoints $calculatedPoints;
  3733.             return $this;
  3734.         }
  3735.         public function getAvatar()
  3736.         {
  3737.             return $this->avatar;
  3738.         }
  3739.         public function setAvatar($avatar): User
  3740.         {
  3741.             $this->avatar $avatar;
  3742.             return $this;
  3743.         }
  3744.         public function getAvatarFile()
  3745.         {
  3746.             return $this->avatarFile;
  3747.         }
  3748.         /**
  3749.          * @param   File|UploadedFile|null  $avatarFile
  3750.          */
  3751.         public function setAvatarFile(?File $avatarFile NULL): void
  3752.         {
  3753.             $this->avatarFile $avatarFile;
  3754.             if (NULL !== $avatarFile) {
  3755.                 $this->updatedAt = new DateTime();
  3756.             }
  3757.         }
  3758.         public function getLogo()
  3759.         {
  3760.             return $this->logo;
  3761.         }
  3762.         public function setLogo($logo): User
  3763.         {
  3764.             $this->logo $logo;
  3765.             return $this;
  3766.         }
  3767.         public function getLogoFile()
  3768.         {
  3769.             return $this->logoFile;
  3770.         }
  3771.         /**
  3772.          * @param   File|UploadedFile|null  $logoFile
  3773.          */
  3774.         public function setLogoFile(?File $logoFile NULL): void
  3775.         {
  3776.             $this->logoFile $logoFile;
  3777.             if (NULL !== $logoFile) {
  3778.                 $this->updatedAt = new DateTime();
  3779.             }
  3780.         }
  3781.         public function getPointOfSale(): ?PointOfSale
  3782.         {
  3783.             return $this->pointOfSale;
  3784.         }
  3785.         public function setPointOfSale(?PointOfSale $pointOfSale): User
  3786.         {
  3787.             $this->pointOfSale $pointOfSale;
  3788.             return $this;
  3789.         }
  3790.         /**
  3791.          * @return Collection<int, PointOfSale>
  3792.          */
  3793.         public function getManagedPointOfSales(): Collection
  3794.         {
  3795.             return $this->managedPointOfSales;
  3796.         }
  3797.         public function addManagedPointOfSale(PointOfSale $managedPointOfSale): User
  3798.         {
  3799.             if (!$this->managedPointOfSales->contains($managedPointOfSale)) {
  3800.                 $this->managedPointOfSales[] = $managedPointOfSale;
  3801.                 $managedPointOfSale->addManager($this);
  3802.             }
  3803.             return $this;
  3804.         }
  3805.         public function removeManagedPointOfSale(PointOfSale $managedPointOfSale): User
  3806.         {
  3807.             if ($this->managedPointOfSales->removeElement($managedPointOfSale)) {
  3808.                 $managedPointOfSale->removeManager($this);
  3809.             }
  3810.             return $this;
  3811.         }
  3812.         /**
  3813.          * @return Collection<int, Parameter>
  3814.          */
  3815.         public function getRelatedParameters(): Collection
  3816.         {
  3817.             return $this->relatedParameters;
  3818.         }
  3819.         public function addRelatedParameter(Parameter $relatedParameter): User
  3820.         {
  3821.             if (!$this->relatedParameters->contains($relatedParameter)) {
  3822.                 $this->relatedParameters[] = $relatedParameter;
  3823.                 $relatedParameter->setUserRelated($this);
  3824.             }
  3825.             return $this;
  3826.         }
  3827.         public function removeRelatedParameter(Parameter $relatedParameter): User
  3828.         {
  3829.             if ($this->relatedParameters->removeElement($relatedParameter)) {
  3830.                 // set the owning side to null (unless already changed)
  3831.                 if ($relatedParameter->getUserRelated() === $this) {
  3832.                     $relatedParameter->setUserRelated(NULL);
  3833.                 }
  3834.             }
  3835.             return $this;
  3836.         }
  3837.         public function getCompanyLegalStatus(): ?string
  3838.         {
  3839.             return $this->companyLegalStatus;
  3840.         }
  3841.         public function setCompanyLegalStatus(?string $companyLegalStatus): User
  3842.         {
  3843.             $this->companyLegalStatus $companyLegalStatus;
  3844.             return $this;
  3845.         }
  3846.         /**
  3847.          * @return Collection<int, PointOfSale>
  3848.          */
  3849.         public function getCreatedPointOfSales(): Collection
  3850.         {
  3851.             return $this->createdPointOfSales;
  3852.         }
  3853.         public function addCreatedPointOfSale(PointOfSale $createdPointOfSale): User
  3854.         {
  3855.             if (!$this->createdPointOfSales->contains($createdPointOfSale)) {
  3856.                 $this->createdPointOfSales[] = $createdPointOfSale;
  3857.                 $createdPointOfSale->setCreatedBy($this);
  3858.             }
  3859.             return $this;
  3860.         }
  3861.         public function removeCreatedPointOfSale(PointOfSale $createdPointOfSale): User
  3862.         {
  3863.             if ($this->createdPointOfSales->removeElement($createdPointOfSale)) {
  3864.                 // set the owning side to null (unless already changed)
  3865.                 if ($createdPointOfSale->getCreatedBy() === $this) {
  3866.                     $createdPointOfSale->setCreatedBy(NULL);
  3867.                 }
  3868.             }
  3869.             return $this;
  3870.         }
  3871.         /**
  3872.          * Serializer\VirtualProperty()
  3873.          * @Serializer\SerializedName("count_created_point_of_sales")
  3874.          *
  3875.          * @return mixed
  3876.          * @Expose()
  3877.          * @Groups ({"export_user_datatable", "user"})
  3878.          */
  3879.         public function countCreatedPointOfSales(): int
  3880.         {
  3881.             return $this->createdPointOfSales->count();
  3882.         }
  3883.         /**
  3884.          * @return Collection<int, PointConversionRate>
  3885.          */
  3886.         public function getOwnerPointConversionRates(): Collection
  3887.         {
  3888.             return $this->ownerPointConversionRates;
  3889.         }
  3890.         public function addOwnerPointConversionRate(PointConversionRate $ownerPointConversionRate): User
  3891.         {
  3892.             if (!$this->ownerPointConversionRates->contains($ownerPointConversionRate)) {
  3893.                 $this->ownerPointConversionRates[] = $ownerPointConversionRate;
  3894.                 $ownerPointConversionRate->setOwner($this);
  3895.             }
  3896.             return $this;
  3897.         }
  3898.         public function removeOwnerPointConversionRate(PointConversionRate $ownerPointConversionRate): User
  3899.         {
  3900.             if ($this->ownerPointConversionRates->removeElement($ownerPointConversionRate)) {
  3901.                 // set the owning side to null (unless already changed)
  3902.                 if ($ownerPointConversionRate->getOwner() === $this) {
  3903.                     $ownerPointConversionRate->setOwner(NULL);
  3904.                 }
  3905.             }
  3906.             return $this;
  3907.         }
  3908.         /**
  3909.          * @return PointConversionRate|null
  3910.          */
  3911.         public function getPointConversionRate()
  3912.         {
  3913.             return $this->pointConversionRate;
  3914.         }
  3915.         /**
  3916.          * @param   mixed  $pointConversionRate
  3917.          *
  3918.          * @return User
  3919.          */
  3920.         public function setPointConversionRate($pointConversionRate)
  3921.         {
  3922.             $this->pointConversionRate $pointConversionRate;
  3923.             return $this;
  3924.         }
  3925.         public function getFonction(): ?string
  3926.         {
  3927.             return $this->fonction;
  3928.         }
  3929.         public function setFonction(?string $fonction): User
  3930.         {
  3931.             $this->fonction $fonction;
  3932.             return $this;
  3933.         }
  3934.         public function getResponsableRegate(): ?Regate
  3935.         {
  3936.             return $this->responsableRegate;
  3937.         }
  3938.         public function setResponsableRegate(?Regate $responsableRegate): User
  3939.         {
  3940.             $this->responsableRegate $responsableRegate;
  3941.             return $this;
  3942.         }
  3943.         public function getRegistrationDocument(): ?string
  3944.         {
  3945.             return $this->registrationDocument;
  3946.         }
  3947.         public function setRegistrationDocument(?string $registrationDocument): User
  3948.         {
  3949.             $this->registrationDocument $registrationDocument;
  3950.             return $this;
  3951.         }
  3952.         public function getRegistrationDocumentFile()
  3953.         {
  3954.             return $this->registrationDocumentFile;
  3955.         }
  3956.         /**
  3957.          * @param   File|UploadedFile|null  $registrationDocumentFile
  3958.          */
  3959.         public function setRegistrationDocumentFile(?File $registrationDocumentFile NULL): void
  3960.         {
  3961.             $this->registrationDocumentFile $registrationDocumentFile;
  3962.             if (NULL !== $registrationDocumentFile) {
  3963.                 $this->updatedAt = new DateTime();
  3964.             }
  3965.         }
  3966.         public function getOldStatus(): ?string
  3967.         {
  3968.             return $this->oldStatus;
  3969.         }
  3970.         public function setOldStatus(?string $oldStatus): User
  3971.         {
  3972.             $this->oldStatus $oldStatus;
  3973.             return $this;
  3974.         }
  3975.         public function getDisabledAt(): ?DateTimeInterface
  3976.         {
  3977.             return $this->disabledAt;
  3978.         }
  3979.         public function setDisabledAt(?DateTimeInterface $disabledAt): User
  3980.         {
  3981.             $this->disabledAt $disabledAt;
  3982.             return $this;
  3983.         }
  3984.         public function getArchiveReason(): ?string
  3985.         {
  3986.             return $this->archiveReason;
  3987.         }
  3988.         public function setArchiveReason(?string $archiveReason): User
  3989.         {
  3990.             $this->archiveReason $archiveReason;
  3991.             return $this;
  3992.         }
  3993.         public function getUnsubscribeReason(): ?string
  3994.         {
  3995.             return $this->unsubscribeReason;
  3996.         }
  3997.         public function setUnsubscribeReason(?string $unsubscribeReason): User
  3998.         {
  3999.             $this->unsubscribeReason $unsubscribeReason;
  4000.             return $this;
  4001.         }
  4002.         /**
  4003.          * @return Collection<int, ActionLog>
  4004.          */
  4005.         public function getActionLogs(): Collection
  4006.         {
  4007.             return $this->actionLogs;
  4008.         }
  4009.         public function addActionLog(ActionLog $ActionLog): User
  4010.         {
  4011.             if (!$this->actionLogs->contains($ActionLog)) {
  4012.                 $this->actionLogs[] = $ActionLog;
  4013.                 $ActionLog->setUser($this);
  4014.             }
  4015.             return $this;
  4016.         }
  4017.         public function removeActionLog(ActionLog $ActionLog): User
  4018.         {
  4019.             if ($this->actionLogs->removeElement($ActionLog)) {
  4020.                 // set the owning side to null (unless already changed)
  4021.                 if ($ActionLog->getUser() === $this) {
  4022.                     $ActionLog->setUser(NULL);
  4023.                 }
  4024.             }
  4025.             return $this;
  4026.         }
  4027.         public function getFailedAttempts(): int
  4028.         {
  4029.             return $this->failedAttempts;
  4030.         }
  4031.         public function setFailedAttempts(int $failedAttempts): User
  4032.         {
  4033.             $this->failedAttempts $failedAttempts;
  4034.             return $this;
  4035.         }
  4036.         public function getLastFailedAttempt()
  4037.         {
  4038.             return $this->lastFailedAttempt;
  4039.         }
  4040.         public function setLastFailedAttempt($lastFailedAttempt): User
  4041.         {
  4042.             $this->lastFailedAttempt $lastFailedAttempt;
  4043.             return $this;
  4044.         }
  4045.         public function getPasswordUpdatedAt(): ?DateTimeInterface
  4046.         {
  4047.             return $this->passwordUpdatedAt;
  4048.         }
  4049.         public function setPasswordUpdatedAt(?DateTimeInterface $passwordUpdatedAt): User
  4050.         {
  4051.             $this->passwordUpdatedAt $passwordUpdatedAt;
  4052.             return $this;
  4053.         }
  4054.         public function getBirthPlace(): ?string
  4055.         {
  4056.             return $this->birthPlace;
  4057.         }
  4058.         public function setBirthPlace(?string $birthPlace): void
  4059.         {
  4060.             $this->birthPlace $birthPlace;
  4061.         }
  4062.         public function getUserAnswers()
  4063.         {
  4064.             return $this->userAnswers;
  4065.         }
  4066.         public function setUserAnswers($userAnswers): void
  4067.         {
  4068.             $this->userAnswers $userAnswers;
  4069.         }
  4070.         /**
  4071.          * @return Collection<int, PasswordHistory>
  4072.          */
  4073.         public function getPasswordHistories(): Collection
  4074.         {
  4075.             return $this->passwordHistories;
  4076.         }
  4077.         public function addPasswordHistory(PasswordHistory $passwordHistory): User
  4078.         {
  4079.             if (!$this->passwordHistories->contains($passwordHistory)) {
  4080.                 $this->passwordHistories[] = $passwordHistory;
  4081.                 $passwordHistory->setUser($this);
  4082.             }
  4083.             return $this;
  4084.         }
  4085.         public function removePasswordHistory(PasswordHistory $passwordHistory): User
  4086.         {
  4087.             if ($this->passwordHistories->removeElement($passwordHistory)) {
  4088.                 // set the owning side to null (unless already changed)
  4089.                 if ($passwordHistory->getUser() === $this) {
  4090.                     $passwordHistory->setUser(NULL);
  4091.                 }
  4092.             }
  4093.             return $this;
  4094.         }
  4095.         public function getLastActivity(): ?DateTimeInterface
  4096.         {
  4097.             return $this->lastActivity;
  4098.         }
  4099.         public function setLastActivity(?DateTimeInterface $lastActivity): User
  4100.         {
  4101.             $this->lastActivity $lastActivity;
  4102.             return $this;
  4103.         }
  4104.     }