src/Entity/User.php line 2078

Open in your IDE?
  1. <?php
  2. namespace EADPlataforma\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use Symfony\Component\Security\Core\User\UserInterface;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use EADPlataforma\Validator\Constraints as EADAssert;
  8. use EADPlataforma\Services\FileService;
  9. use EADPlataforma\Util\StringUtil;
  10. use EADPlataforma\Enum\UserEnum;
  11. use \DateTime;
  12. /**
  13.  * User
  14.  *
  15.  * @ORM\Table(name="user", indexes={
  16.  *      @ORM\Index(name="fk_user_country_id", columns={"country_id"}), 
  17.  *      @ORM\Index(name="fk_user_state_id", columns={"state_id"}), 
  18.  *      @ORM\Index(name="fk_user_city_id", columns={"city_id"}),
  19.  *      @ORM\Index(name="fk_user_user_profile_id", columns={"user_profile_id"}),
  20.  *      @ORM\Index(name="fk_user_user_delete_id", columns={"user_delete_id"})
  21.  * })
  22.  *
  23.  * @ORM\Entity(repositoryClass="EADPlataforma\Repository\UserRepository")
  24.  *
  25.  */
  26. class User implements UserInterface
  27. {
  28.     /**
  29.      * @var int
  30.      *
  31.      * @ORM\Column(name="id", type="integer", nullable=false)
  32.      * @ORM\Id
  33.      * @ORM\GeneratedValue(strategy="IDENTITY")
  34.      */
  35.     private $id;
  36.     /**
  37.      * @Assert\NotBlank(
  38.      *      message = "Deleted not informed"
  39.      * )
  40.      *
  41.      * @Assert\Choice(
  42.      *      choices = { 
  43.      *                      UserEnum::ITEM_NO_DELETED, 
  44.      *                      UserEnum::ITEM_ON_TRASH,
  45.      *                      UserEnum::ITEM_DELETED
  46.      *                },
  47.      *      message = "Delete Option Invalid"
  48.      * )
  49.      *
  50.      * @var int
  51.      *
  52.      * @ORM\Column(name="deleted", type="integer", nullable=false, options={"default"="0"})
  53.      */
  54.     private $deleted UserEnum::ITEM_NO_DELETED;
  55.     /**
  56.      * @Assert\NotBlank(
  57.      *      message = "Hash not informed"
  58.      * )
  59.      *
  60.      * @var string
  61.      *
  62.      * @ORM\Column(name="hash_identify", type="string", length=80, nullable=true)
  63.      */
  64.     private $hashIdentify;
  65.     /**
  66.      * @Assert\NotBlank(
  67.      *      message = "Name not informed"
  68.      * )
  69.      * 
  70.      * @Assert\Length(
  71.      *      min = 0,
  72.      *      max = 75
  73.      * )
  74.      *
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="name", type="string", length=80, nullable=false)
  78.      */
  79.     private $name;
  80.     /**
  81.      * @Assert\NotBlank(
  82.      *      message = "Email not informed"
  83.      * )
  84.      *
  85.      * @Assert\Email(
  86.      *      message = "Email Invalid"
  87.      * )
  88.      * 
  89.      * @Assert\Length(
  90.      *      min = 0,
  91.      *      max = 75
  92.      * )
  93.      *
  94.      * @var string
  95.      *
  96.      * @ORM\Column(name="email", type="string", length=80, nullable=false)
  97.      */
  98.     private $email;
  99.     /**
  100.      * @Assert\NotBlank(
  101.      *      message = "Password not informed"
  102.      * )
  103.      * 
  104.      * @Assert\Length(
  105.      *      min = 6,
  106.      *      max = 40
  107.      * )
  108.      *
  109.      * @var string
  110.      *
  111.      * @ORM\Column(name="password", type="string", length=45, nullable=false)
  112.      */
  113.     private $password;
  114.     /**
  115.      * @var string
  116.      *
  117.      * @ORM\Column(name="old_password", type="text", nullable=true)
  118.      */
  119.     private $oldPassword;
  120.     /**
  121.      * @Assert\NotBlank(
  122.      *      message = "Username not informed"
  123.      * )
  124.      * 
  125.      * @Assert\Length(
  126.      *      min = 0,
  127.      *      max = 250
  128.      * )
  129.      *
  130.      * @var string
  131.      *
  132.      * @ORM\Column(name="username", type="string", length=255, nullable=false)
  133.      */
  134.     private $username;
  135.     /**
  136.      * @Assert\NotBlank(
  137.      *    message = "Type not informed"
  138.      * )
  139.      *
  140.      * @Assert\Choice(
  141.      *      choices = { UserEnum::STUDENT, UserEnum::TUTOR, UserEnum::TEACHER, UserEnum::ADMIN },
  142.      *      message = "Type Invalid"
  143.      * )
  144.      *
  145.      * @var int
  146.      *
  147.      * @ORM\Column(name="type", type="integer", nullable=false, options={"default"="1"})
  148.      */
  149.     private $type UserEnum::STUDENT;
  150.     /**
  151.      * @Assert\NotBlank(
  152.      *    message = "Old Status not informed"
  153.      * )
  154.      *
  155.      * @Assert\Choice(
  156.      *      choices = { 
  157.      *                      UserEnum::WAITING, 
  158.      *                      UserEnum::ACTIVE, 
  159.      *                      UserEnum::BLOCK,
  160.      *                      UserEnum::INACTIVE 
  161.      *                 },
  162.      *      message = "Old Status Invalid"
  163.      * )
  164.      *
  165.      * @var int
  166.      *
  167.      * @ORM\Column(name="old_status", type="integer", nullable=false, options={"default"="0"})
  168.      */
  169.     private $oldStatus UserEnum::WAITING;
  170.     /**
  171.      * @Assert\NotBlank(
  172.      *    message = "Status not informed"
  173.      * )
  174.      *
  175.      * @Assert\Choice(
  176.      *      choices = { 
  177.      *                      UserEnum::WAITING, 
  178.      *                      UserEnum::ACTIVE, 
  179.      *                      UserEnum::BLOCK,
  180.      *                      UserEnum::INACTIVE 
  181.      *                 },
  182.      *      message = "Status Invalid"
  183.      * )
  184.      *
  185.      * @var int
  186.      *
  187.      * @ORM\Column(name="status", type="integer", nullable=false, options={"default"="0"})
  188.      */
  189.     private $status UserEnum::WAITING;
  190.     /**
  191.      * @Assert\NotBlank(
  192.      *      message = "Valid Email not informed"
  193.      * )
  194.      *
  195.      * @Assert\Choice(
  196.      *      choices = { 
  197.      *                      UserEnum::UNKNOWN, 
  198.      *                      UserEnum::DELIVERABLE,
  199.      *                      UserEnum::UNDELIVERABLE,
  200.      *                      UserEnum::REFUSE
  201.      *                },
  202.      *      message = "Delete Option Invalid"
  203.      * )
  204.      *
  205.      * @var int
  206.      *
  207.      * @ORM\Column(name="valid_email", type="integer", nullable=false, options={"default"="0"})
  208.      */
  209.     private $validEmail UserEnum::UNKNOWN;
  210.     /**
  211.      * @Assert\NotBlank(
  212.      *    message = "Complete not informed"
  213.      * )
  214.      *
  215.      * @Assert\Choice(
  216.      *      choices = { UserEnum::NO, UserEnum::YES },
  217.      *      message = "Complete Invalid"
  218.      * )
  219.      *
  220.      * @var int
  221.      *
  222.      * @ORM\Column(name="complete", type="integer", nullable=false, options={"default"="0"})
  223.      */
  224.     private $complete UserEnum::NO;
  225.     /**
  226.      * @Assert\NotBlank(
  227.      *    message = "Spotlight not informed"
  228.      * )
  229.      *
  230.      * @Assert\Choice(
  231.      *      choices = { UserEnum::NO, UserEnum::YES },
  232.      *      message = "Spotlight Invalid"
  233.      * )
  234.      *
  235.      * @var int
  236.      *
  237.      * @ORM\Column(name="teacher_spotlight", type="integer", nullable=false, options={"default"="0"})
  238.      */
  239.     private $teacherSpotlight UserEnum::NO;
  240.     /**
  241.      * @Assert\NotBlank(
  242.      *    message = "Permission not informed"
  243.      * )
  244.      *
  245.      * @Assert\Json(
  246.      *     message = "Permission is an invalid Json."
  247.      * )
  248.      *
  249.      * @var string
  250.      *
  251.      * @ORM\Column(name="permission", type="text", nullable=false)
  252.      */
  253.     private $permission;
  254.     /**
  255.      * @Assert\NotBlank(
  256.      *    message = "Date Register not informed"
  257.      * )
  258.      *
  259.      * @EADAssert\DateTimeEAD(
  260.      *      message = "Date Register Invalid"
  261.      * )
  262.      *
  263.      * @var \DateTime
  264.      *
  265.      * @ORM\Column(name="date_register", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"})
  266.      */
  267.     private $dateRegister;
  268.     /**
  269.      * @EADAssert\DateTimeEAD(
  270.      *      message = "Date Last Access Invalid"
  271.      * )
  272.      *
  273.      * @var \DateTime
  274.      *
  275.      * @ORM\Column(name="date_last_access", type="datetime", nullable=true, options={"default"="CURRENT_TIMESTAMP"})
  276.      */
  277.     private $dateLastAccess;
  278.     /**
  279.      * @var string
  280.      *
  281.      * @ORM\Column(name="authentication_secret_key", type="string", length=80, nullable=true)
  282.      */
  283.     private $authenticationSecretKey;
  284.     /**
  285.      * @var string
  286.      *
  287.      * @ORM\Column(name="authentication_code_email", type="string", length=10, nullable=true)
  288.      */
  289.     private $authenticationCodeEmail;
  290.     /**
  291.      * @EADAssert\DateTimeEAD(
  292.      *      message = "Authentication Email Date Expire Invalid"
  293.      * )
  294.      *
  295.      * @var \DateTime
  296.      *
  297.      * @ORM\Column(name="authentication_email_date_expire", type="datetime", nullable=true)
  298.      */
  299.     private $authenticationEmailDateExpire;
  300.     /**
  301.      * @Assert\NotBlank(
  302.      *    message = "Authentication Allow not informed"
  303.      * )
  304.      *
  305.      * @Assert\Choice(
  306.      *      choices = { UserEnum::NO, UserEnum::YES },
  307.      *      message = "Allow Authentication Invalid"
  308.      * )
  309.      *
  310.      * @var int
  311.      *
  312.      * @ORM\Column(name="authentication_allow", type="integer", nullable=false, options={"default"="0"})
  313.      */
  314.     private $authenticationAllow UserEnum::NO;
  315.     /**
  316.      * @Assert\NotBlank(
  317.      *    message = "Allow Receiver not informed"
  318.      * )
  319.      *
  320.      * @Assert\Choice(
  321.      *      choices = { UserEnum::NO, UserEnum::YES },
  322.      *      message = "Allow Receiver Invalid"
  323.      * )
  324.      *
  325.      * @var int
  326.      *
  327.      * @ORM\Column(name="allow_receiver", type="integer", nullable=false, options={"default"="0"})
  328.      */
  329.     private $allowReceiver UserEnum::NO;
  330.     /**
  331.      * @Assert\NotBlank(
  332.      *    message = "Allow Onde Click Buy not informed"
  333.      * )
  334.      *
  335.      * @Assert\Choice(
  336.      *      choices = { UserEnum::NO, UserEnum::YES },
  337.      *      message = "Allow Onde Click Buy Invalid"
  338.      * )
  339.      *
  340.      * @var int
  341.      *
  342.      * @ORM\Column(name="allow_one_click_buy", type="integer", nullable=false, options={"default"="1"})
  343.      */
  344.     private $allowOneClickBuy UserEnum::YES;
  345.     /**
  346.      * @Assert\NotBlank(
  347.      *    message = "Allow Notify New Lesson not informed"
  348.      * )
  349.      *
  350.      * @Assert\Choice(
  351.      *      choices = { UserEnum::NO, UserEnum::YES },
  352.      *      message = "Allow Notify New Lesson Invalid"
  353.      * )
  354.      *
  355.      * @var int
  356.      *
  357.      * @ORM\Column(name="allow_notify_new_lesson", type="integer", nullable=false, options={"default"="1"})
  358.      */
  359.     private $allowNotifyNewLesson UserEnum::YES;
  360.     /**
  361.      * @Assert\NotBlank(
  362.      *    message = "Allow Notify New Exam not informed"
  363.      * )
  364.      *
  365.      * @Assert\Choice(
  366.      *      choices = { UserEnum::NO, UserEnum::YES },
  367.      *      message = "Allow Notify New Exam Invalid"
  368.      * )
  369.      *
  370.      * @var int
  371.      *
  372.      * @ORM\Column(name="allow_notify_new_exam", type="integer", nullable=false, options={"default"="1"})
  373.      */
  374.     private $allowNotifyNewExam UserEnum::YES;
  375.     
  376.     /**
  377.      * @Assert\NotBlank(
  378.      *    message = "Allow Notify New Support Message not informed"
  379.      * )
  380.      *
  381.      * @Assert\Choice(
  382.      *      choices = { UserEnum::NO, UserEnum::YES },
  383.      *      message = "Allow Notify New Support Message Invalid"
  384.      * )
  385.      *
  386.      * @var int
  387.      *
  388.      * @ORM\Column(name="allow_notify_new_support_message", type="integer", nullable=false, options={"default"="1"})
  389.      */
  390.     private $allowNotifyNewSupportMessage UserEnum::YES;
  391.     
  392.     /**
  393.      * @Assert\NotBlank(
  394.      *    message = "Allow Notify New Support Answer not informed"
  395.      * )
  396.      *
  397.      * @Assert\Choice(
  398.      *      choices = { UserEnum::NO, UserEnum::YES },
  399.      *      message = "Allow Notify New Support Answer Invalid"
  400.      * )
  401.      *
  402.      * @var int
  403.      *
  404.      * @ORM\Column(name="allow_notify_new_support_answer", type="integer", nullable=false, options={"default"="1"})
  405.      */
  406.     private $allowNotifyNewSupportAnswer UserEnum::YES;
  407.     
  408.     /**
  409.      * @Assert\NotBlank(
  410.      *    message = "Allow Notify New Message not informed"
  411.      * )
  412.      *
  413.      * @Assert\Choice(
  414.      *      choices = { UserEnum::NO, UserEnum::YES },
  415.      *      message = "Allow Notify New Message Invalid"
  416.      * )
  417.      *
  418.      * @var int
  419.      *
  420.      * @ORM\Column(name="allow_notify_new_message", type="integer", nullable=false, options={"default"="1"})
  421.      */
  422.     private $allowNotifyNewMessage UserEnum::YES;
  423.     /**
  424.      * @Assert\NotBlank(
  425.      *    message = "Allow Notify New Group Message not informed"
  426.      * )
  427.      *
  428.      * @Assert\Choice(
  429.      *      choices = { UserEnum::NO, UserEnum::YES },
  430.      *      message = "Allow Notify New Group Message Invalid"
  431.      * )
  432.      *
  433.      * @var int
  434.      *
  435.      * @ORM\Column(name="allow_notify_new_group_message", type="integer", nullable=false, options={"default"="1"})
  436.      */
  437.     private $allowNotifyNewGroupMessage UserEnum::YES;
  438.     
  439.     /**
  440.      * @Assert\NotBlank(
  441.      *    message = "Allow Notify Cart not informed"
  442.      * )
  443.      *
  444.      * @Assert\Choice(
  445.      *      choices = { UserEnum::NO, UserEnum::YES },
  446.      *      message = "Allow Notify Cart Invalid"
  447.      * )
  448.      *
  449.      * @var int
  450.      *
  451.      * @ORM\Column(name="allow_notify_cart", type="integer", nullable=false, options={"default"="1"})
  452.      */
  453.     private $allowNotifyCart UserEnum::YES;
  454.     /**
  455.      * @Assert\Length(
  456.      *      min = 0,
  457.      *      max = 40
  458.      * )
  459.      * 
  460.      * @var string|null
  461.      *
  462.      * @ORM\Column(name="document", type="string", length=45, nullable=true)
  463.      */
  464.     private $document;
  465.     /**
  466.      * @Assert\Length(
  467.      *      min = 0,
  468.      *      max = 250
  469.      * )
  470.      * 
  471.      * @var string|null
  472.      *
  473.      * @ORM\Column(name="photo", type="string", length=255, nullable=true)
  474.      */
  475.     private $photo;
  476.     /**
  477.      * @Assert\Length(
  478.      *      min = 0,
  479.      *      max = 230
  480.      * )
  481.      * 
  482.      * @var string|null
  483.      *
  484.      * @ORM\Column(name="cover", type="string", length=235, nullable=true)
  485.      */
  486.     private $cover;
  487.     /**
  488.      * @Assert\Length(
  489.      *      min = 0,
  490.      *      max = 45
  491.      * )
  492.      * 
  493.      * @var string|null
  494.      *
  495.      * @ORM\Column(name="occupation", type="string", length=50, nullable=true)
  496.      */
  497.     private $occupation;
  498.     /**
  499.      * @Assert\Length(
  500.      *      min = 0,
  501.      *      max = 175
  502.      * )
  503.      * 
  504.      * @var string|null
  505.      *
  506.      * @ORM\Column(name="biography", type="string", length=180, nullable=true)
  507.      */
  508.     private $biography;
  509.     /**
  510.      * @var string|null
  511.      *
  512.      * @ORM\Column(name="resume", type="text", length=0, nullable=true)
  513.      */
  514.     private $resume;
  515.     /**
  516.      * @var string|null
  517.      *
  518.      * @ORM\Column(name="custom", type="text", length=0, nullable=true)
  519.      */
  520.     private $custom;
  521.     /**
  522.      * @var string|null
  523.      *
  524.      * @ORM\Column(name="notes", type="text", length=0, nullable=true)
  525.      */
  526.     private $notes;
  527.     /**
  528.      * @EADAssert\DateEAD(
  529.      *      message = "Birth Date Invalid"
  530.      * )
  531.      *
  532.      * @var Date|null
  533.      *
  534.      * @ORM\Column(name="birth_date", type="date", nullable=true)
  535.      */
  536.     private $birthDate;
  537.     /**
  538.      * @Assert\Length(
  539.      *      min = 0,
  540.      *      max = 40
  541.      * )
  542.      * 
  543.      * @var string|null
  544.      *
  545.      * @ORM\Column(name="phone", type="string", length=45, nullable=true)
  546.      */
  547.     private $phone;
  548.     /**
  549.      * @Assert\Length(
  550.      *      min = 0,
  551.      *      max = 40
  552.      * )
  553.      * 
  554.      * @var string|null
  555.      *
  556.      * @ORM\Column(name="zip_code", type="string", length=45, nullable=true)
  557.      */
  558.     private $zipCode;
  559.     /**
  560.      * @Assert\Length(
  561.      *      min = 0,
  562.      *      max = 115
  563.      * )
  564.      * 
  565.      * @var string|null
  566.      *
  567.      * @ORM\Column(name="address", type="string", length=120, nullable=true)
  568.      */
  569.     private $address;
  570.     /**
  571.      * @Assert\Length(
  572.      *      min = 0,
  573.      *      max = 10
  574.      * )
  575.      * 
  576.      * @var string|null
  577.      *
  578.      * @ORM\Column(name="address_number", type="string", length=15, nullable=true)
  579.      */
  580.     private $addressNumber;
  581.     /**
  582.      * @Assert\Length(
  583.      *      min = 0,
  584.      *      max = 115
  585.      * )
  586.      * 
  587.      * @var string|null
  588.      *
  589.      * @ORM\Column(name="address_complement", type="string", length=120, nullable=true)
  590.      */
  591.     private $addressComplement;
  592.     /**
  593.      * @Assert\Length(
  594.      *      min = 0,
  595.      *      max = 60
  596.      * )
  597.      * 
  598.      * @var string|null
  599.      *
  600.      * @ORM\Column(name="address_neighborhood", type="string", length=65, nullable=true)
  601.      */
  602.     private $addressNeighborhood;
  603.     /**
  604.      * @Assert\Json(
  605.      *     message = "Custom Field is an invalid Json."
  606.      * )
  607.      *
  608.      * @var string
  609.      *
  610.      * @ORM\Column(name="custom_field", type="text", nullable=true)
  611.      */
  612.     private $customField;
  613.     /**
  614.      * @Assert\Length(
  615.      *      min = 0,
  616.      *      max = 115
  617.      * )
  618.      * 
  619.      * @var string|null
  620.      *
  621.      * @ORM\Column(name="website", type="string", length=120, nullable=true)
  622.      */
  623.     private $website;
  624.     /**
  625.      * @Assert\Length(
  626.      *      min = 0,
  627.      *      max = 115
  628.      * )
  629.      * 
  630.      * @var string|null
  631.      *
  632.      * @ORM\Column(name="twitter", type="string", length=120, nullable=true)
  633.      */
  634.     private $twitter;
  635.     /**
  636.      * @Assert\Length(
  637.      *      min = 0,
  638.      *      max = 115
  639.      * )
  640.      * 
  641.      * @var string|null
  642.      *
  643.      * @ORM\Column(name="facebook", type="string", length=120, nullable=true)
  644.      */
  645.     private $facebook;
  646.     /**
  647.      * @Assert\Length(
  648.      *      min = 0,
  649.      *      max = 115
  650.      * )
  651.      * 
  652.      * @var string|null
  653.      *
  654.      * @ORM\Column(name="linkedin", type="string", length=120, nullable=true)
  655.      */
  656.     private $linkedin;
  657.     /**
  658.      * @Assert\Length(
  659.      *      min = 0,
  660.      *      max = 115
  661.      * )
  662.      * 
  663.      * @var string|null
  664.      *
  665.      * @ORM\Column(name="youtube", type="string", length=120, nullable=true)
  666.      */
  667.     private $youtube;
  668.     /**
  669.      * @Assert\Length(
  670.      *      min = 0,
  671.      *      max = 115
  672.      * )
  673.      * 
  674.      * @var string|null
  675.      *
  676.      * @ORM\Column(name="instagram", type="string", length=120, nullable=true)
  677.      */
  678.     private $instagram;
  679.     /**
  680.      * @Assert\Length(
  681.      *      min = 0,
  682.      *      max = 115
  683.      * )
  684.      * 
  685.      * @var string|null
  686.      *
  687.      * @ORM\Column(name="tiktok", type="string", length=120, nullable=true)
  688.      */
  689.     private $tiktok;
  690.     /**
  691.      * @Assert\NotBlank(
  692.      *    message = "Invited not informed"
  693.      * )
  694.      *
  695.      * @Assert\Choice(
  696.      *      choices = { UserEnum::NO, UserEnum::YES },
  697.      *      message = "Invited Invalid"
  698.      * )
  699.      *
  700.      * @var int
  701.      *
  702.      * @ORM\Column(name="invited", type="integer", nullable=false, options={"default"="0"})
  703.      */
  704.     private $invited UserEnum::NO;
  705.     /**
  706.      * @EADAssert\DatetimeEAD(
  707.      *      message = "Confirmation Date Invalid"
  708.      * )
  709.      *
  710.      * @var \Date
  711.      *
  712.      * @ORM\Column(name="confirmation_date", type="datetime", nullable=true)
  713.      */
  714.     private $confirmationDate;
  715.     /**
  716.      * @EADAssert\DateEAD(
  717.      *      message = "Recover Date Invalid"
  718.      * )
  719.      *
  720.      * @var \Date
  721.      *
  722.      * @ORM\Column(name="recover_date", type="date", nullable=true)
  723.      */
  724.     private $recoverDate;
  725.     /**
  726.      * @var int
  727.      *
  728.      * @ORM\Column(name="recover_attempt", type="integer", nullable=false, options={"default"="0"})
  729.      */
  730.     private $recoverAttempt "0";
  731.     /**
  732.      * @Assert\NotBlank(
  733.      *    message = "Screen Size not informed"
  734.      * )
  735.      *
  736.      * @Assert\Choice(
  737.      *      choices = { UserEnum::SCREEN_SMALL, UserEnum::SCREEN_MEDIUM, UserEnum::SCREEN_LARGE },
  738.      *      message = "Screen Size"
  739.      * )
  740.      *
  741.      * @var int
  742.      *
  743.      * @ORM\Column(name="screen_size", type="integer", nullable=false, options={"default"="2"})
  744.      */
  745.     private $screenSize UserEnum::SCREEN_MEDIUM;
  746.     /**
  747.      * @Assert\NotBlank(
  748.      *    message = "Autoplay not informed"
  749.      * )
  750.      *
  751.      * @Assert\Choice(
  752.      *      choices = { UserEnum::NO, UserEnum::YES },
  753.      *      message = "Autoplay Invalid"
  754.      * )
  755.      *
  756.      * @var int
  757.      *
  758.      * @ORM\Column(name="autoplay", type="integer", nullable=false, options={"default"="0"})
  759.      */
  760.     private $autoplay UserEnum::NO;
  761.     /**
  762.      * @Assert\NotBlank(
  763.      *    message = "Accept Terms not informed"
  764.      * )
  765.      *
  766.      * @Assert\Choice(
  767.      *      choices = { UserEnum::NO, UserEnum::YES },
  768.      *      message = "Accept Terms Invalid"
  769.      * )
  770.      *
  771.      * @var int
  772.      *
  773.      * @ORM\Column(name="accept_terms", type="integer", nullable=false, options={"default"="0"})
  774.      */
  775.     private $acceptTerms UserEnum::NO;
  776.     /**
  777.      * @var string|null
  778.      *
  779.      * @ORM\Column(name="accept_terms_contract", type="text", length=0, nullable=true)
  780.      */
  781.     private $acceptTermsContract;
  782.     /**
  783.      * @EADAssert\DateTimeEAD(
  784.      *      message = "Accept Terms Date Invalid"
  785.      * )
  786.      *
  787.      * @var \DateTime|null
  788.      *
  789.      * @ORM\Column(name="accept_terms_date", type="datetime", nullable=true)
  790.      */
  791.     private $acceptTermsDate;
  792.     /**
  793.      * @var int
  794.      *
  795.      * @ORM\Column(name="pipedrive_person_id", type="integer", nullable=true)
  796.      */
  797.     private $pipedrivePerson;
  798.     /**
  799.      * @Assert\Valid
  800.      *
  801.      * @var \City
  802.      *
  803.      * @ORM\ManyToOne(targetEntity="City")
  804.      * @ORM\JoinColumns({
  805.      *   @ORM\JoinColumn(name="city_id", referencedColumnName="id", nullable=true)
  806.      * })
  807.      */
  808.     private $city;
  809.     /**
  810.      * @Assert\Valid
  811.      *
  812.      * @var \State
  813.      *
  814.      * @ORM\ManyToOne(targetEntity="State")
  815.      * @ORM\JoinColumns({
  816.      *   @ORM\JoinColumn(name="state_id", referencedColumnName="id", nullable=true)
  817.      * })
  818.      */
  819.     private $state;
  820.     /**
  821.      * @Assert\Valid
  822.      *
  823.      * @var \Country
  824.      *
  825.      * @ORM\ManyToOne(targetEntity="Country")
  826.      * @ORM\JoinColumns({
  827.      *   @ORM\JoinColumn(name="country_id", referencedColumnName="id", nullable=true)
  828.      * })
  829.      */
  830.     private $country;
  831.     /**
  832.      * @Assert\NotBlank(
  833.      *    message = "User Profile not informed"
  834.      * )
  835.      *
  836.      * @Assert\Valid
  837.      *
  838.      * @var \UserProfile
  839.      *
  840.      * @ORM\ManyToOne(targetEntity="UserProfile")
  841.      * @ORM\JoinColumns({
  842.      *   @ORM\JoinColumn(name="user_profile_id", referencedColumnName="id", nullable=false)
  843.      * })
  844.      */
  845.     private $userProfile;
  846.     /**
  847.      * @var \Session
  848.      */
  849.     private $session;
  850.     /**
  851.      * @var \Doctrine\Common\Collections\Collection
  852.      *
  853.      * @ORM\ManyToMany(targetEntity="Group", mappedBy="user")
  854.      */
  855.     private $group;
  856.     /**
  857.      * @Assert\Valid
  858.      *
  859.      * @var \EADPlataforma\Entity\User
  860.      *
  861.      * @ORM\ManyToOne(targetEntity="User")
  862.      * @ORM\JoinColumns({
  863.      *   @ORM\JoinColumn(name="user_delete_id", referencedColumnName="id", nullable=true)
  864.      * })
  865.      */
  866.     private $userDelete;
  867.     /**
  868.      * @Assert\Choice(
  869.      *      choices = { 
  870.      *                      UserEnum::INDIVIDUAL, 
  871.      *                      UserEnum::CASCADE
  872.      *                },
  873.      *      message = "Type Delete Invalid"
  874.      * )
  875.      *
  876.      * @var int
  877.      *
  878.      * @ORM\Column(name="type_delete", type="integer", nullable=true)
  879.      */
  880.     private $typeDelete;
  881.     /**
  882.      * @EADAssert\DateTimeEAD(
  883.      *      message = "Date Delete Invalid"
  884.      * )
  885.      *
  886.      * @var \DateTime|null
  887.      *
  888.      * @ORM\Column(name="date_delete", type="datetime", nullable=true)
  889.      */
  890.     private $dateDelete;
  891.     /**
  892.      * Constructor
  893.      */
  894.     public function __construct()
  895.     {
  896.         $this->setDateRegister(date('Y-m-d H:i:s'));
  897.         $this->group = new \Doctrine\Common\Collections\ArrayCollection();
  898.         $this->hashIdentify md5(rand() . strtotime(date('Y-m-d H:i:s')));
  899.         $this->hashIdentify .= md5(
  900.             rand() . password_hash($this->hashIdentifyPASSWORD_DEFAULT)
  901.         );
  902.     }
  903.     public function getId(): ?int
  904.     {
  905.         return $this->id;
  906.     }
  907.    public function getHashIdentify(): ?string
  908.     {
  909.         return $this->hashIdentify;
  910.     }
  911.     public function setHashIdentify(?string $hashIdentify): self
  912.     {
  913.         $this->hashIdentify $hashIdentify;
  914.         return $this;
  915.     }
  916.     public function getName(): ?string
  917.     {
  918.         return StringUtil::encodeStringStatic($this->name);
  919.     }
  920.     public function setName(string $name): self
  921.     {
  922.         $this->name $name;
  923.         return $this;
  924.     }
  925.     public function getEmail(): ?string
  926.     {
  927.         return $this->email;
  928.     }
  929.     public function setEmail(string $email): self
  930.     {
  931.         $this->email $email;
  932.         return $this;
  933.     }
  934.     public function getPassword(): ?string
  935.     {
  936.         return $this->password;
  937.     }
  938.     public function setPassword(string $password): self
  939.     {   
  940.         $this->password md5($password);
  941.         if($password == UserEnum::PASSWORD_RESET){
  942.             $this->password $password;
  943.         }
  944.         return $this;
  945.     }
  946.     public function getOldPassword(?bool $origin false): ?array
  947.     {
  948.         if($origin){
  949.             if(empty($this->oldPassword)){
  950.                 return [];
  951.             }
  952.             return json_decode($this->oldPassword);
  953.         }
  954.         return $this->oldPassword;
  955.     }
  956.     public function setOldPassword(string $oldPassword): self
  957.     {
  958.         if(empty($this->oldPassword)){
  959.             $this->oldPassword json_encode([ $oldPassword ]);
  960.         }
  961.         $oldPass json_decode($this->oldPassword);
  962.         $oldPass[] = $oldPassword;
  963.         $this->oldPassword json_encode($oldPass);
  964.         return $this;
  965.     }
  966.     public function getUsername(): ?string
  967.     {
  968.         return StringUtil::encodeStringStatic($this->username);
  969.     }
  970.     public function setUsername(string $username): self
  971.     {
  972.         $this->username StringUtil::slugStatic($usernametrue);
  973.         return $this;
  974.     }
  975.     public function getType(): ?int
  976.     {
  977.         return $this->type;
  978.     }
  979.     public function setType(int $type): self
  980.     {
  981.         $this->type $type;
  982.         return $this;
  983.     }
  984.     public function getOldStatus($string false)
  985.     {
  986.         if($string){
  987.             return $this->stringStatus($this->oldStatus);    
  988.         }
  989.         return $this->oldStatus;
  990.     }
  991.     public function setOldStatus(int $oldStatus): self
  992.     {
  993.         $this->oldStatus $oldStatus;
  994.         return $this;
  995.     }
  996.     public function getStatus($string false)
  997.     {
  998.         if($string){
  999.             return $this->stringStatus($this->status);    
  1000.         }
  1001.         return $this->status;
  1002.     }
  1003.     public function setStatus(int $status): self
  1004.     {
  1005.         $this->status $status;
  1006.         return $this;
  1007.     }
  1008.     public function getValidEmail()
  1009.     {
  1010.         return $this->validEmail;
  1011.     }
  1012.     public function setValidEmail(int $validEmail): self
  1013.     {
  1014.         $this->validEmail $validEmail;
  1015.         return $this;
  1016.     }
  1017.     public function getComplete()
  1018.     {
  1019.         return $this->complete;
  1020.     }
  1021.     public function setComplete(int $complete): self
  1022.     {
  1023.         $this->complete $complete;
  1024.         return $this;
  1025.     }
  1026.     public function getTeacherSpotlight()
  1027.     {
  1028.         return $this->teacherSpotlight;
  1029.     }
  1030.     public function setTeacherSpotlight(int $teacherSpotlight): self
  1031.     {
  1032.         $this->teacherSpotlight $teacherSpotlight;
  1033.         return $this;
  1034.     }
  1035.     public function getPermission(): ?string
  1036.     {
  1037.         return $this->permission;
  1038.     }
  1039.     public function setPermission(string $permission): self
  1040.     {
  1041.         $this->permission $permission;
  1042.         return $this;
  1043.     }
  1044.     public function getDateRegister($dateFormat 'Y-m-d H:i:s')
  1045.     {
  1046.         if(!empty($this->dateRegister)){
  1047.             return $this->dateRegister->format($dateFormat);
  1048.         }
  1049.         return $this->dateRegister;
  1050.     }
  1051.     public function setDateRegister($dateRegister): self
  1052.     {
  1053.         if(!empty($dateRegister)){
  1054.             $dateRegister DateTime::createFromFormat('Y-m-d H:i:s'$dateRegister);
  1055.         }
  1056.         $this->dateRegister $dateRegister;
  1057.         return $this;
  1058.     }
  1059.     public function getDateLastAccess($dateFormat 'Y-m-d H:i:s')
  1060.     {
  1061.         if(!empty($this->dateLastAccess)){
  1062.             return $this->dateLastAccess->format($dateFormat);
  1063.         }
  1064.         return $this->dateLastAccess;
  1065.     }
  1066.     public function setDateLastAccess($dateLastAccess): self
  1067.     {
  1068.         if(!empty($dateLastAccess)){
  1069.             $dateLastAccess DateTime::createFromFormat('Y-m-d H:i:s'$dateLastAccess);
  1070.         }
  1071.         $this->dateLastAccess $dateLastAccess;
  1072.         return $this;
  1073.     }
  1074.     public function getAuthenticationSecretKey(): ?string
  1075.     {
  1076.         return $this->authenticationSecretKey;
  1077.     }
  1078.     public function setAuthenticationSecretKey(?string $authenticationSecretKey): self
  1079.     {
  1080.         $this->authenticationSecretKey $authenticationSecretKey;
  1081.         return $this;
  1082.     }
  1083.     public function getAuthenticationCodeEmail(): ?string
  1084.     {
  1085.         return $this->authenticationCodeEmail;
  1086.     }
  1087.     public function setAuthenticationCodeEmail(?string $authenticationCodeEmail): self
  1088.     {
  1089.         $this->authenticationCodeEmail $authenticationCodeEmail;
  1090.         return $this;
  1091.     }
  1092.     public function getAuthenticationEmailDateExpire($dateFormat 'Y-m-d H:i:s')
  1093.     {
  1094.         if(!empty($this->authenticationEmailDateExpire)){
  1095.             return $this->authenticationEmailDateExpire->format($dateFormat);
  1096.         }
  1097.         return $this->authenticationEmailDateExpire;
  1098.     }
  1099.     public function setAuthenticationEmailDateExpire($authenticationEmailDateExpire): self
  1100.     {
  1101.         if(!empty($authenticationEmailDateExpire)){
  1102.             $authenticationEmailDateExpire DateTime::createFromFormat('Y-m-d H:i:s'$authenticationEmailDateExpire);
  1103.         }
  1104.         $this->authenticationEmailDateExpire $authenticationEmailDateExpire;
  1105.         return $this;
  1106.     }
  1107.     public function getAuthenticationAllow(): ?int
  1108.     {
  1109.         return $this->authenticationAllow;
  1110.     }
  1111.     public function setAuthenticationAllow(int $authenticationAllow): self
  1112.     {
  1113.         $this->authenticationAllow $authenticationAllow;
  1114.         return $this;
  1115.     }
  1116.     public function getAllowReceiver(): ?int
  1117.     {
  1118.         return $this->allowReceiver;
  1119.     }
  1120.     public function setAllowReceiver(int $allowReceiver): self
  1121.     {
  1122.         $this->allowReceiver $allowReceiver;
  1123.         return $this;
  1124.     }
  1125.     public function getAllowOneClickBuy(): ?int
  1126.     {
  1127.         return $this->allowOneClickBuy;
  1128.     }
  1129.     public function setAllowOneClickBuy(int $allowOneClickBuy): self
  1130.     {
  1131.         $this->allowOneClickBuy $allowOneClickBuy;
  1132.         return $this;
  1133.     }
  1134.     public function getAllowNotifyNewLesson(): ?int
  1135.     {
  1136.         return $this->allowNotifyNewLesson;
  1137.     }
  1138.     public function setAllowNotifyNewLesson(int $allowNotifyNewLesson): self
  1139.     {
  1140.         $this->allowNotifyNewLesson $allowNotifyNewLesson;
  1141.         return $this;
  1142.     }
  1143.     public function getAllowNotifyNewExam(): ?int
  1144.     {
  1145.         return $this->allowNotifyNewExam;
  1146.     }
  1147.     public function setAllowNotifyNewExam(int $allowNotifyNewExam): self
  1148.     {
  1149.         $this->allowNotifyNewExam $allowNotifyNewExam;
  1150.         return $this;
  1151.     }
  1152.     public function getAllowNotifyNewSupportMessage(): ?int
  1153.     {
  1154.         return $this->allowNotifyNewSupportMessage;
  1155.     }
  1156.     public function setAllowNotifyNewSupportMessage(int $allowNotifyNewSupportMessage): self
  1157.     {
  1158.         $this->allowNotifyNewSupportMessage $allowNotifyNewSupportMessage;
  1159.         return $this;
  1160.     }
  1161.     public function getAllowNotifyNewSupportAnswer(): ?int
  1162.     {
  1163.         return $this->allowNotifyNewSupportAnswer;
  1164.     }
  1165.     public function setAllowNotifyNewSupportAnswer(int $allowNotifyNewSupportAnswer): self
  1166.     {
  1167.         $this->allowNotifyNewSupportAnswer $allowNotifyNewSupportAnswer;
  1168.         return $this;
  1169.     }
  1170.     public function getAllowNotifyNewMessage(): ?int
  1171.     {
  1172.         return $this->allowNotifyNewMessage;
  1173.     }
  1174.     public function setAllowNotifyNewMessage(int $allowNotifyNewMessage): self
  1175.     {
  1176.         $this->allowNotifyNewMessage $allowNotifyNewMessage;
  1177.         return $this;
  1178.     }
  1179.     public function getAllowNotifyNewGroupMessage(): ?int
  1180.     {
  1181.         return $this->allowNotifyNewGroupMessage;
  1182.     }
  1183.     public function setAllowNotifyNewGroupMessage(int $allowNotifyNewGroupMessage): self
  1184.     {
  1185.         $this->allowNotifyNewGroupMessage $allowNotifyNewGroupMessage;
  1186.         return $this;
  1187.     }
  1188.     public function getAllowNotifyCart(): ?int
  1189.     {
  1190.         return $this->allowNotifyCart;
  1191.     }
  1192.     public function setAllowNotifyCart(int $allowNotifyCart): self
  1193.     {
  1194.         $this->allowNotifyCart $allowNotifyCart;
  1195.         return $this;
  1196.     }
  1197.     public function getDocument(): ?string
  1198.     {
  1199.         return $this->document;
  1200.     }
  1201.     public function setDocument(?string $document): self
  1202.     {
  1203.         $this->document $document;
  1204.         return $this;
  1205.     }
  1206.     public function getPhoto(?bool $complete false): ?string
  1207.     {  
  1208.         if($complete){
  1209.             return FileService::getFilePathComplete(
  1210.                 $this->photo
  1211.                 UserEnum::PATH_PROFILES
  1212.                 true
  1213.                 true
  1214.             );
  1215.         }
  1216.         
  1217.         return $this->photo;
  1218.     }
  1219.     public function setPhoto(?string $photo): self
  1220.     {
  1221.         $this->photo $photo;
  1222.         return $this;
  1223.     }
  1224.     public function getCover(): ?string
  1225.     {   
  1226.         return $this->cover;
  1227.     }
  1228.     public function setCover(?string $cover): self
  1229.     {
  1230.         $this->cover $cover;
  1231.         return $this;
  1232.     }
  1233.     public function getOccupation(): ?string
  1234.     {
  1235.         return StringUtil::encodeStringStatic($this->occupation);
  1236.     }
  1237.     public function setOccupation(?string $occupation): self
  1238.     {
  1239.         $this->occupation $occupation;
  1240.         return $this;
  1241.     }
  1242.     public function getBiography(): ?string
  1243.     {
  1244.         return StringUtil::encodeStringStatic($this->biography);
  1245.     }
  1246.     public function setBiography(?string $biography): self
  1247.     {
  1248.         $this->biography $biography;
  1249.         return $this;
  1250.     }
  1251.     public function getResume(): ?string
  1252.     {
  1253.         return StringUtil::encodeStringStatic($this->resume);
  1254.     }
  1255.     public function setResume(?string $resume): self
  1256.     {
  1257.         $this->resume $resume;
  1258.         return $this;
  1259.     }
  1260.     public function getCustom(): ?string
  1261.     {
  1262.         return StringUtil::encodeStringStatic($this->custom);
  1263.     }
  1264.     public function setCustom(?string $custom): self
  1265.     {
  1266.         $this->custom $custom;
  1267.         return $this;
  1268.     }
  1269.     public function getNotes(): ?string
  1270.     {
  1271.         return StringUtil::encodeStringStatic($this->notes);
  1272.     }
  1273.     public function setNotes(?string $notes): self
  1274.     {
  1275.         $this->notes $notes;
  1276.         return $this;
  1277.     }
  1278.     public function getBirthDate($dateFormat 'Y-m-d')
  1279.     {
  1280.         if(!empty($this->birthDate)){
  1281.             return $this->birthDate->format($dateFormat);
  1282.         }
  1283.         return $this->birthDate;
  1284.     }
  1285.     public function setBirthDate($birthDate): self
  1286.     {
  1287.         if(!empty($birthDate)){
  1288.             $birthDate DateTime::createFromFormat('Y-m-d'$birthDate);
  1289.         }else{
  1290.             $birthDate null;
  1291.         }
  1292.         $this->birthDate $birthDate;
  1293.         return $this;
  1294.     }
  1295.     public function getPhone(): ?string
  1296.     {
  1297.         return $this->phone;
  1298.     }
  1299.     public function setPhone(?string $phone): self
  1300.     {
  1301.         $this->phone $phone;
  1302.         return $this;
  1303.     }
  1304.     public function getZipCode(): ?string
  1305.     {
  1306.         return $this->zipCode;
  1307.     }
  1308.     public function setZipCode(?string $zipCode): self
  1309.     {
  1310.         $this->zipCode $zipCode;
  1311.         return $this;
  1312.     }
  1313.     public function getAddress(): ?string
  1314.     {
  1315.         return StringUtil::encodeStringStatic($this->address);
  1316.     }
  1317.     public function setAddress(?string $address): self
  1318.     {
  1319.         $this->address $address;
  1320.         return $this;
  1321.     }
  1322.     public function getAddressNumber(): ?string
  1323.     {
  1324.         return $this->addressNumber;
  1325.     }
  1326.     public function setAddressNumber(?string $addressNumber): self
  1327.     {
  1328.         $this->addressNumber $addressNumber;
  1329.         return $this;
  1330.     }
  1331.     public function getAddressComplement(): ?string
  1332.     {
  1333.         return $this->addressComplement;
  1334.     }
  1335.     public function setAddressComplement(?string $addressComplement): self
  1336.     {
  1337.         $this->addressComplement $addressComplement;
  1338.         return $this;
  1339.     }
  1340.     public function getAddressNeighborhood(): ?string
  1341.     {
  1342.         return StringUtil::encodeStringStatic($this->addressNeighborhood);
  1343.     }
  1344.     public function setAddressNeighborhood(?string $addressNeighborhood): self
  1345.     {
  1346.         $this->addressNeighborhood $addressNeighborhood;
  1347.         return $this;
  1348.     }
  1349.     public function getCustomField(): ?string
  1350.     {
  1351.         return  StringUtil::encodeStringStatic($this->customField);
  1352.     }
  1353.     public function setCustomField(?string $customField): self
  1354.     {
  1355.         $this->customField $customField;
  1356.         return $this;
  1357.     }
  1358.     
  1359.     public function getWebsite(): ?string
  1360.     {
  1361.         return $this->website;
  1362.     }
  1363.     public function setWebsite(?string $website): self
  1364.     {
  1365.         $this->website $website;
  1366.         return $this;
  1367.     }
  1368.     public function getTwitter(): ?string
  1369.     {
  1370.         return $this->twitter;
  1371.     }
  1372.     public function setTwitter(?string $twitter): self
  1373.     {
  1374.         $this->twitter $twitter;
  1375.         return $this;
  1376.     }
  1377.     public function getFacebook(): ?string
  1378.     {
  1379.         return $this->facebook;
  1380.     }
  1381.     public function setFacebook(?string $facebook): self
  1382.     {
  1383.         $this->facebook $facebook;
  1384.         return $this;
  1385.     }
  1386.     public function getLinkedin(): ?string
  1387.     {
  1388.         return $this->linkedin;
  1389.     }
  1390.     public function setLinkedin(?string $linkedin): self
  1391.     {
  1392.         $this->linkedin $linkedin;
  1393.         return $this;
  1394.     }
  1395.     public function getYoutube(): ?string
  1396.     {
  1397.         return $this->youtube;
  1398.     }
  1399.     public function setYoutube(?string $youtube): self
  1400.     {
  1401.         $this->youtube $youtube;
  1402.         return $this;
  1403.     }
  1404.     public function getInstagram(): ?string
  1405.     {
  1406.         return $this->instagram;
  1407.     }
  1408.     public function setInstagram(?string $instagram): self
  1409.     {
  1410.         $this->instagram $instagram;
  1411.         return $this;
  1412.     }
  1413.     public function getTiktok(): ?string
  1414.     {
  1415.         return $this->tiktok;
  1416.     }
  1417.     public function setTiktok(?string $tiktok): self
  1418.     {
  1419.         $this->tiktok $tiktok;
  1420.         return $this;
  1421.     }
  1422.     public function getInvited(): ?int
  1423.     {
  1424.         return $this->invited;
  1425.     }
  1426.     public function setInvited(?int $invited): self
  1427.     {
  1428.         $this->invited $invited;
  1429.         return $this;
  1430.     }
  1431.     public function getConfirmationDate($dateFormat 'Y-m-d H:i:s')
  1432.     {
  1433.         if(!empty($this->confirmationDate)){
  1434.             return $this->confirmationDate->format($dateFormat);
  1435.         }
  1436.         return $this->confirmationDate;
  1437.     }
  1438.     public function setConfirmationDate($confirmationDate): self
  1439.     {
  1440.         if(!empty($confirmationDate)){
  1441.             $confirmationDate DateTime::createFromFormat('Y-m-d H:i:s'$confirmationDate);
  1442.         }
  1443.         $this->confirmationDate $confirmationDate;
  1444.         return $this;
  1445.     }
  1446.     public function getRecoverDate($dateFormat 'Y-m-d')
  1447.     {
  1448.         if(!empty($this->recoverDate)){
  1449.             return $this->recoverDate->format($dateFormat);
  1450.         }
  1451.         return $this->recoverDate;
  1452.     }
  1453.     public function setRecoverDate($recoverDate): self
  1454.     {
  1455.         if(!empty($recoverDate)){
  1456.             $recoverDate DateTime::createFromFormat('Y-m-d'$recoverDate);
  1457.         }
  1458.         
  1459.         $this->recoverDate $recoverDate;
  1460.         return $this;
  1461.     }
  1462.     public function getRecoverAttempt(): ?int
  1463.     {
  1464.         return $this->recoverAttempt;
  1465.     }
  1466.     public function setRecoverAttempt(?int $recoverAttempt): self
  1467.     {
  1468.         $this->recoverAttempt $recoverAttempt;
  1469.         return $this;
  1470.     }
  1471.     public function getScreenSize(): ?int
  1472.     {
  1473.         return $this->screenSize;
  1474.     }
  1475.     public function setScreenSize(?int $screenSize): self
  1476.     {
  1477.         $this->screenSize $screenSize;
  1478.         return $this;
  1479.     }
  1480.     public function getAutoplay(): ?int
  1481.     {
  1482.         return $this->autoplay;
  1483.     }
  1484.     public function setAutoplay(?int $autoplay): self
  1485.     {
  1486.         $this->autoplay $autoplay;
  1487.         return $this;
  1488.     }
  1489.     public function getAcceptTerms(): ?int
  1490.     {
  1491.         return $this->acceptTerms;
  1492.     }
  1493.     public function setAcceptTerms(?int $acceptTerms): self
  1494.     {
  1495.         $this->acceptTerms $acceptTerms;
  1496.         return $this;
  1497.     }
  1498.     public function getAcceptTermsContract(): ?string
  1499.     {
  1500.         return StringUtil::encodeStringStatic($this->acceptTermsContract);
  1501.     }
  1502.     public function setAcceptTermsContract(?string $acceptTermsContract): self
  1503.     {
  1504.         $this->acceptTermsContract $acceptTermsContract;
  1505.         return $this;
  1506.     }
  1507.     public function getAcceptTermsDate($dateFormat 'Y-m-d H:i:s')
  1508.     {
  1509.         if($this->acceptTermsDate){
  1510.             return $this->acceptTermsDate->format($dateFormat);
  1511.         }
  1512.         return $this->acceptTermsDate;
  1513.     }
  1514.     public function setAcceptTermsDate($acceptTermsDate): self
  1515.     {
  1516.         if(!empty($acceptTermsDate)){
  1517.             $acceptTermsDate DateTime::createFromFormat('Y-m-d H:i:s'$acceptTermsDate);
  1518.         }
  1519.         
  1520.         $this->acceptTermsDate $acceptTermsDate;
  1521.         return $this;
  1522.     }
  1523.     public function getPipedrivePerson(): ?int
  1524.     {
  1525.         return $this->pipedrivePerson;
  1526.     }
  1527.     public function setPipedrivePerson(?int $pipedrivePerson): self
  1528.     {
  1529.         $this->pipedrivePerson $pipedrivePerson;
  1530.         return $this;
  1531.     }
  1532.     public function getCity(): ?City
  1533.     {
  1534.         return $this->city;
  1535.     }
  1536.     public function setCity(?City $city): self
  1537.     {
  1538.         $this->city $city;
  1539.         return $this;
  1540.     }
  1541.     public function getState(): ?State
  1542.     {
  1543.         return $this->state;
  1544.     }
  1545.     public function setState(?State $state): self
  1546.     {
  1547.         $this->state $state;
  1548.         return $this;
  1549.     }
  1550.     public function getCountry(): ?Country
  1551.     {
  1552.         return $this->country;
  1553.     }
  1554.     public function setCountry(?Country $country): self
  1555.     {
  1556.         $this->country $country;
  1557.         return $this;
  1558.     }
  1559.     public function getUserProfile(): ?UserProfile
  1560.     {
  1561.         return $this->userProfile;
  1562.     }
  1563.     public function setUserProfile(?UserProfile $userProfile): self
  1564.     {
  1565.         $this->userProfile $userProfile;
  1566.         
  1567.         return $this;
  1568.     }
  1569.     public function getSession(): ?Session
  1570.     {
  1571.         return $this->session;
  1572.     }
  1573.     public function setSession(?Session $session): self
  1574.     {
  1575.         $this->session $session;
  1576.         
  1577.         return $this;
  1578.     }
  1579.     public function getUserDelete(): ?User
  1580.     {
  1581.         return $this->userDelete;
  1582.     }
  1583.     public function setUserDelete(?User $userDelete): self
  1584.     {
  1585.         $this->userDelete $userDelete;
  1586.         return $this;
  1587.     }
  1588.     
  1589.     public function getDateDelete($dateFormat 'Y-m-d H:i:s')
  1590.     {
  1591.         if($this->dateDelete){
  1592.             return $this->dateDelete->format($dateFormat);
  1593.         }
  1594.         return $this->dateDelete;
  1595.     }
  1596.     public function setDateDelete($dateDelete): self
  1597.     {
  1598.         if(!empty($dateDelete)){
  1599.             $dateDelete DateTime::createFromFormat('Y-m-d H:i:s'$dateDelete);
  1600.         }
  1601.         
  1602.         $this->dateDelete $dateDelete;
  1603.         return $this;
  1604.     }
  1605.     /**
  1606.      * @return Collection|Group[]
  1607.      */
  1608.     public function getGroup(): Collection
  1609.     {
  1610.         return $this->group;
  1611.     }
  1612.     public function addGroup(\EADPlataforma\Entity\Group $group): self
  1613.     {
  1614.         if (!$this->group->contains($group)) {
  1615.             $this->group[] = $group;
  1616.             $group->addUser($this);
  1617.         }
  1618.         return $this;
  1619.     }
  1620.     public function removeGroup(\EADPlataforma\Entity\Group $group): self
  1621.     {
  1622.         if ($this->group->contains($group)) {
  1623.             $this->group->removeElement($group);
  1624.             $group->removeUser($this);
  1625.         }
  1626.         return $this;
  1627.     }
  1628.     public function removeAllGroup(): self
  1629.     {
  1630.         $this->group = new \Doctrine\Common\Collections\ArrayCollection();
  1631.         return $this;
  1632.     }
  1633.     
  1634.     // ******* UserInterface ******* //
  1635.     
  1636.     public function getRoles() {
  1637.         return [ 'ROLE_USER' ];
  1638.     }
  1639.     public function getSalt() {
  1640.         
  1641.     }
  1642.     public function eraseCredentials() {
  1643.         
  1644.     }
  1645.     // ******* UserInterface ******* //
  1646.     public function individual(): self
  1647.     {
  1648.         $this->typeDelete UserEnum::INDIVIDUAL;
  1649.         return $this;
  1650.     }
  1651.     public function cascade(): self
  1652.     {
  1653.         $this->typeDelete UserEnum::CASCADE;
  1654.         return $this;
  1655.     }
  1656.     public function isLive(): bool
  1657.     {
  1658.         return ($this->deleted == UserEnum::ITEM_NO_DELETED);
  1659.     }
  1660.     public function isOnTrash(): bool
  1661.     {
  1662.         return ($this->deleted == UserEnum::ITEM_ON_TRASH);
  1663.     }
  1664.     public function isDeleted(): bool
  1665.     {
  1666.         return ($this->deleted == UserEnum::ITEM_DELETED);
  1667.     }
  1668.     public function restore(): self
  1669.     {
  1670.         $this->deleted UserEnum::ITEM_NO_DELETED;
  1671.         return $this;
  1672.     }
  1673.     public function trash(): self
  1674.     {
  1675.         $this->deleted UserEnum::ITEM_ON_TRASH;
  1676.         return $this;
  1677.     }
  1678.     public function delete(): self
  1679.     {
  1680.         $this->deleted UserEnum::ITEM_DELETED;
  1681.         return $this;
  1682.     }
  1683.     public function stringStatus($status){
  1684.         $string '';
  1685.         switch ($status) {
  1686.             case UserEnum::WAITING:
  1687.                 $string 'Waiting';
  1688.             break;
  1689.             case UserEnum::ACTIVE:
  1690.                 $string 'Active';
  1691.             break;
  1692.             case UserEnum::BLOCK:
  1693.                 $string 'Blocked';
  1694.             break;
  1695.             case UserEnum::INACTIVE:
  1696.                 $string 'Inactive';
  1697.             break;
  1698.         }
  1699.         return $string;
  1700.     }
  1701.     public function toReturnClean(){
  1702.         $data = [
  1703.             "name" => $this->getName(),
  1704.             "email" => $this->email,
  1705.             "username" => $this->getUsername(),
  1706.             "dateRegister" => $this->getDateRegister(),
  1707.             "document" => $this->document,
  1708.             "photo" => FileService::getFilePathComplete(
  1709.                 $this->photo
  1710.                 UserEnum::PATH_PROFILES
  1711.                 true
  1712.                 true
  1713.             ),
  1714.             "cover" => FileService::getFilePathComplete(
  1715.                 $this->cover
  1716.                 UserEnum::PATH_COVERS_PROFILE
  1717.                 true
  1718.                 true
  1719.             ),
  1720.             "birthDate" => $this->getBirthDate(),
  1721.             "phone" => $this->phone,
  1722.             "zipCode" => $this->zipCode,
  1723.             "address" => $this->getAddress(),
  1724.             "addressNumber" => $this->addressNumber,
  1725.             "addressComplement" => $this->addressComplement,
  1726.             "addressNeighborhood" => $this->getAddressNeighborhood(),
  1727.             "city" => ( $this->city $this->city->getId() : null ),
  1728.             "state" => ( $this->state $this->state->getId() : null ),
  1729.             "country" => ( $this->country $this->country->getId() : null ),
  1730.             "cityName" => ( $this->city $this->city->getName() : null ),
  1731.             "stateName" => ( $this->state $this->state->getName() : null ),
  1732.             "countryName" => ( $this->country $this->country->getName() : null ),
  1733.         ];
  1734.         return $data;
  1735.     }
  1736.     public function toReturn($isProfile false){
  1737.         $arrGroup = [];
  1738.         foreach ($this->group as $key => $group) {
  1739.             $arrGroup[] = $group->getId();
  1740.         }
  1741.         $data = [
  1742.             "complete" => $this->complete,
  1743.             "teacherSpotlight" => $this->teacherSpotlight,
  1744.             "name" => $this->getName(),
  1745.             "email" => $this->email,
  1746.             "password" => $this->password,
  1747.             "username" => $this->getUsername(),
  1748.             "dateRegister" => $this->getDateRegister(),
  1749.             "authenticationSecretKey" => $this->authenticationSecretKey,
  1750.             "authenticationCodeEmail" => $this->authenticationCodeEmail,
  1751.             "authenticationEmailDateExpire" => $this->authenticationEmailDateExpire,
  1752.             "authenticationAllow" => $this->authenticationAllow,
  1753.             "allowReceiver" => $this->allowReceiver,
  1754.             "allowOneClickBuy" => $this->allowOneClickBuy,
  1755.             "allowNotifyNewLesson" => $this->allowNotifyNewLesson,
  1756.             "allowNotifyNewExam" => $this->allowNotifyNewExam,
  1757.             "allowNotifyNewSupportMessage" => $this->allowNotifyNewSupportMessage,
  1758.             "allowNotifyNewSupportAnswer" => $this->allowNotifyNewSupportAnswer,
  1759.             "allowNotifyNewMessage" => $this->allowNotifyNewMessage,
  1760.             "allowNotifyNewGroupMessage" => $this->allowNotifyNewGroupMessage,
  1761.             "allowNotifyCart" => $this->allowNotifyCart,
  1762.             "document" => $this->document,
  1763.             "photo" => FileService::getFilePathComplete(
  1764.                 $this->photo
  1765.                 UserEnum::PATH_PROFILES
  1766.                 true
  1767.                 true
  1768.             ),
  1769.             "cover" => FileService::getFilePathComplete(
  1770.                 $this->cover
  1771.                 UserEnum::PATH_COVERS_PROFILE
  1772.                 true
  1773.                 true
  1774.             ),
  1775.             "occupation" => $this->getOccupation(),
  1776.             "biography" => $this->getBiography(),
  1777.             "resume" => $this->getResume(),
  1778.             "custom" => $this->getCustom(),
  1779.             "notes" => $this->getNotes(),
  1780.             "birthDate" => $this->getBirthDate(),
  1781.             "phone" => $this->phone,
  1782.             "zipCode" => $this->zipCode,
  1783.             "address" => $this->getAddress(),
  1784.             "addressNumber" => $this->addressNumber,
  1785.             "addressComplement" => $this->addressComplement,
  1786.             "addressNeighborhood" => $this->getAddressNeighborhood(),
  1787.             "customField" => $this->getCustomField(),
  1788.             "website" => $this->website,
  1789.             "twitter" => $this->twitter,
  1790.             "facebook" => $this->facebook,
  1791.             "linkedin" => $this->linkedin,
  1792.             "youtube" => $this->youtube,
  1793.             "instagram" => $this->instagram,
  1794.             "tiktok" => $this->tiktok,
  1795.             "pipedrivePerson" => $this->pipedrivePerson,
  1796.             "city" => ( $this->city $this->city->getId() : null ),
  1797.             "state" => ( $this->state $this->state->getId() : null ),
  1798.             "country" => ( $this->country $this->country->getId() : null ),
  1799.             "cityName" => ( $this->city $this->city->getName() : null ),
  1800.             "stateName" => ( $this->state $this->state->getName() : null ),
  1801.             "countryName" => ( $this->country $this->country->getName() : null ),
  1802.             "userDelete" => ( $this->userDelete $this->userDelete->getId() : null ),
  1803.             "typeDelete" => $this->typeDelete,
  1804.             "dateDelete" => $this->getDateDelete()
  1805.         ];
  1806.         if(!$isProfile){
  1807.             $data["id"] = $this->id;
  1808.             $data["deleted"] = $this->deleted;
  1809.             $data["hashIdentify"] = $this->hashIdentify;
  1810.             $data["userProfile"] = ( 
  1811.                 $this->userProfile $this->userProfile->getId() : null 
  1812.             );
  1813.             $data["userProfileName"] = ( 
  1814.                 $this->userProfile $this->userProfile->getName() : null 
  1815.             );
  1816.             $data["type"] = $this->type;
  1817.             $data["oldStatus"] = $this->oldStatus;
  1818.             $data["status"] = $this->status;
  1819.             $data["validEmail"] = $this->validEmail;
  1820.             $data["permission"] = $this->permission;
  1821.             $data["invited"] = $this->invited;
  1822.             $data["confirmationDate"] = $this->getConfirmationDate();
  1823.             $data["recoverDate"] = $this->getRecoverDate();
  1824.             $data["recoverAttempt"] = $this->recoverAttempt;
  1825.             $data["screenSize"] = $this->screenSize;
  1826.             $data["autoplay"] = $this->autoplay;
  1827.             $data["acceptTerms"] = $this->acceptTerms;
  1828.             $data["acceptTermsContract"] = $this->acceptTermsContract;
  1829.             $data["acceptTermsDate"] = $this->getAcceptTermsDate();
  1830.             $data["session"] = ( $this->session $this->session->getId() : null );
  1831.             $data["group"] = $arrGroup;
  1832.         }
  1833.         return $data;
  1834.     }
  1835.     public function toWebhook()
  1836.     {
  1837.         return (object)[
  1838.             "id" => (string)$this->getId(),
  1839.             "name" => (string)$this->getName(),
  1840.             "email" => (string)$this->getEmail(),
  1841.             "phone" => (string)$this->getPhone(),
  1842.             "status" => (int)$this->getStatus(),
  1843.             "address" => [
  1844.                 "street" => $this->getAddress(),
  1845.                 "number" => $this->getAddressNumber(),
  1846.                 "complement" => $this->getAddressComplement(),
  1847.                 "neighborhood" => $this->getAddressNeighborhood(),
  1848.                 "city" => ($this->getCity() ? $this->getCity()->getName() : null),
  1849.                 "state" => ($this->getState() ? $this->getState()->getUf() : null),
  1850.                 "zipcode" => $this->getZipCode(),
  1851.                 "country" => ($this->getCountry() ? $this->getCountry()->getName() : null),
  1852.             ],
  1853.             "dates" => (object)[
  1854.                 "signup" => (string)$this->getDateRegister('Y-m-d H:i:s'),
  1855.                 "confirmation" => (string)$this->getConfirmationDate('Y-m-d H:i:s'),
  1856.             ],
  1857.         ];
  1858.     }
  1859.     public function toReturnApi(){
  1860.         $arrGroup = [];
  1861.         foreach ($this->group as $key => $group) {
  1862.             $arrGroup[] = $group->getId();
  1863.         }
  1864.         $data = [
  1865.             "aluno_id" => $this->id,
  1866.             "nome" => $this->getName(),
  1867.             "email" => $this->email,
  1868.             "senha" => $this->password,
  1869.             "username" => $this->getUsername(),
  1870.             "tipo" => $this->type,
  1871.             "permissao_id" => ( $this->userProfile $this->userProfile->getId() : null ),
  1872.             "oldStatus" => $this->oldStatus,
  1873.             "status" => $this->status,
  1874.             "cpf" => $this->document,
  1875.             "foto" => FileService::getFilePathComplete(
  1876.                 $this->photo
  1877.                 UserEnum::PATH_PROFILES
  1878.                 true
  1879.                 true
  1880.             ),
  1881.             "ocupacao" => $this->getOccupation(),
  1882.             "personalizado" => $this->getCustom(),
  1883.             "anotacoes" => $this->getNotes(),
  1884.             "nascimento" => $this->getBirthDate(),
  1885.             "telefone" => $this->phone,
  1886.             "cep" => $this->zipCode,
  1887.             "endereco" => $this->getAddress(),
  1888.             "numero" => $this->addressNumber,
  1889.             "complemento" => $this->addressComplement,
  1890.             "bairro" => $this->getAddressNeighborhood(),
  1891.         ];
  1892.         return $data;
  1893.     }
  1894. }