src/Entity/User.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Traits\CreatedUpdatedTrait;
  6. use JMS\Serializer\Annotation as Serializer;
  7. use JMS\Serializer\Annotation\Expose;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use JMS\Serializer\Annotation\ExclusionPolicy;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Symfony\Component\HttpFoundation\File\File;
  12. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  13. use Symfony\Component\Security\Core\User\UserInterface;
  14. /**
  15.  * @ORM\Table(name="v_user",indexes={
  16.  *     @ORM\Index(name="api_key_idx", fields={"apiToken"}),
  17.  *     @ORM\Index(name="name_idx", fields={"name"}),
  18.  *     @ORM\Index(name="phone_idx", fields={"phone"}),
  19.  *     @ORM\Index(name="email_idx", fields={"email"}),
  20.  *     @ORM\Index(name="clinic_code_idx", fields={"clinicCode"}),
  21.  *     @ORM\Index(name="firebase_id_idx", fields={"firebaseId"}),
  22.  * })
  23.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  24.  * @ExclusionPolicy("all")
  25.  * @Gedmo\Loggable
  26.  * @Vich\Uploadable
  27.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  28.  */
  29. class User implements UserInterface
  30. {
  31.     const USER_TYPE_PATIENT 'PATIENT';
  32.     const USER_TYPE_FOLLOWER 'FOLLOWER';
  33.     public static function getUserTypes(){
  34.         return [
  35.             self::USER_TYPE_PATIENT => 'Patient',
  36.             self::USER_TYPE_FOLLOWER => 'Follower',
  37.         ];
  38.     }
  39.     const REGISTRATION_METHOD_SMS 'SMS';
  40.     const REGISTRATION_METHOD_EMAIL 'EMAIL';
  41.     const REGISTRATION_METHOD_APPLE 'APPLE';
  42.     const REGISTRATION_METHOD_FACEBOOK 'FACEBOOK';
  43.     const REGISTRATION_METHOD_GOOGLE 'GOOGLE';
  44.     const USER_SUBSCRIPTION_TYPE_CLINIC 'CLINIC';
  45.     const USER_SUBSCRIPTION_TYPE_FREEMIUM 'FREEMIUM';
  46.     const USER_SUBSCRIPTION_TYPE_NOSUB 'NOSUB';
  47.     const USER_SUBSCRIPTION_TYPE_UNSUBSCRIBED 'UNSUBSCRIBED';
  48.     public static function getSubscriptionTypeDefinitions(){
  49.         return [
  50.             self::USER_SUBSCRIPTION_TYPE_CLINIC => 'Clinic',
  51.             self::USER_SUBSCRIPTION_TYPE_FREEMIUM => 'Freemium',
  52.             self::USER_SUBSCRIPTION_TYPE_NOSUB => 'No Sub',
  53.             self::USER_SUBSCRIPTION_TYPE_UNSUBSCRIBED => 'Unsubscribed',
  54.         ];
  55.     }
  56.     public static function getRegistrationMethodDefinitions(){
  57.         return [
  58.             self::REGISTRATION_METHOD_APPLE => 'Apple',
  59.             self::REGISTRATION_METHOD_EMAIL => 'Email',
  60.             self::REGISTRATION_METHOD_FACEBOOK => 'Facebook',
  61.             self::REGISTRATION_METHOD_GOOGLE => 'Google',
  62.             self::REGISTRATION_METHOD_SMS => 'Sms',
  63.         ];
  64.     }
  65.     const USER_SUB_USER_TYPE_ACTIVE 'ACTIVE';
  66.     const USER_SUB_USER_TYPE_INACTIVE 'INACTIVE';
  67.     public static function getSubUserTypeDefinitions(){
  68.         return [
  69.             self::USER_SUB_USER_TYPE_ACTIVE => 'Active',
  70.             self::USER_SUB_USER_TYPE_INACTIVE => 'Inactive',
  71.         ];
  72.     }
  73.     const GENDER_MALE 'MALE';
  74.     const GENDER_FEMALE 'FEMALE';
  75.     const GENDER_OTHER 'OTHER';
  76.     public static function getGenderDefinitions(){
  77.         return [
  78.             self::GENDER_MALE => 'Male',
  79.             self::GENDER_FEMALE => 'Female',
  80.             self::GENDER_OTHER => 'Other',
  81.         ];
  82.     }
  83.     const USER_ACTIVE_YES 'YES';
  84.     const USER_ACTIVE_NO 'NO';
  85.     const USER_ACTIVE_CURIOUS 'CURIOUS';
  86.     const USER_ACTIVE_REPRESENT 'REPRESENT';
  87.     public static function getActiveDefinitions()
  88.     {
  89.         return [
  90.             self::USER_ACTIVE_YES => 'Yes',
  91.             self::USER_ACTIVE_NO => 'No',
  92.             self::USER_ACTIVE_CURIOUS => 'Curious',
  93.             self::USER_ACTIVE_REPRESENT => 'Represent',
  94.         ];
  95.     }
  96.     const USER_CLINIC_TYPE_IOM 'IOM';
  97.     const USER_CLINIC_TYPE_HAIR_TRANSPLANTATION 'HAIR_TRANSPLANTATION';
  98.     const USER_ACTIVE_OTHER 'OTHER';
  99.     public static function getClinicTypeDefinitions()
  100.     {
  101.         return [
  102.             self::USER_CLINIC_TYPE_IOM => 'IOM',
  103.             self::USER_CLINIC_TYPE_HAIR_TRANSPLANTATION => 'HAIR_TRANSPLANTATION',
  104.             self::USER_ACTIVE_OTHER => 'Other',
  105.         ];
  106.     }
  107.     const APP_USAGE_HELP 'HELP';
  108.     const APP_USAGE_AFTER_CARE_SUPPORT 'AFTER_CARE_SUPPORT';
  109.     const APP_USAGE_INFO_BUSINESS 'INFO_BUSINESS';
  110.     public static function getAppUsageDefinitions()
  111.     {
  112.         return [
  113.             self::APP_USAGE_HELP => 'Help',
  114.             self::APP_USAGE_AFTER_CARE_SUPPORT => 'After Care Support',
  115.             self::APP_USAGE_INFO_BUSINESS => 'Info Business',
  116.         ];
  117.     }
  118.     /**
  119.      * @ORM\Id()
  120.      * @ORM\GeneratedValue()
  121.      * @ORM\Column(type="integer")
  122.      * @Expose
  123.      */
  124.     private $id;
  125.     /**
  126.      * @ORM\Column(type="string", length=255, nullable=true)
  127.      * @Expose
  128.      * @Gedmo\Versioned
  129.      */
  130.     private $name;
  131.     /**
  132.      * @ORM\Column(type="string", length=10, nullable=true)
  133.      * @Expose
  134.      * @Gedmo\Versioned
  135.      */
  136.     private $gender;
  137.     /**
  138.      * @ORM\Column(type="string", length=255, unique=true)
  139.      * @Expose
  140.      * @Gedmo\Versioned
  141.      */
  142.     private $email;
  143.     /**
  144.      * @ORM\Column(type="string", length=80, nullable=true)
  145.      * @Expose
  146.      * @Gedmo\Versioned
  147.      */
  148.     private $phone;
  149.     /**
  150.      * @ORM\Column(name="firebase_id", type="string", length=80, nullable=true)
  151.      * @Gedmo\Versioned
  152.      */
  153.     private $firebaseId;
  154.     /**
  155.      * @var string[]
  156.      * @ORM\Column(type="json", nullable=true)
  157.      * @Gedmo\Versioned
  158.      */
  159.     private $roles;
  160.     /**
  161.      * @var string Salt
  162.      * @ORM\Column(type="string")
  163.      */
  164.     private $salt;
  165.     /**
  166.      * @var string The hashed password
  167.      * @ORM\Column(type="string")
  168.      */
  169.     private $password;
  170.     /**
  171.      * Plain password. Used for model validation. Must not be persisted.
  172.      * @var string
  173.      */
  174.     private $plainPassword;
  175.     /**
  176.      * @var boolean
  177.      * @ORM\Column(type="boolean")
  178.      * @Expose
  179.      */
  180.     private $confirmed false;
  181.     /**
  182.      * @var boolean
  183.      * @ORM\Column(type="boolean")
  184.      * @Expose
  185.      * @Gedmo\Versioned
  186.      */
  187.     private $enabled true;
  188.     /**
  189.      * @var boolean
  190.      * @ORM\Column(type="boolean")
  191.      * @Expose
  192.      * @Gedmo\Versioned
  193.      */
  194.     private $notificationEnabled true;
  195.     /**
  196.      * @var \DateTime
  197.      *
  198.      * @ORM\Column(name="disabled_at", type="datetime", nullable=true)
  199.      * @Expose
  200.      * @Gedmo\Versioned
  201.      */
  202.     private $disabledAt;
  203.     /**
  204.      * @ORM\Column(name="api_token", type="string", nullable=true)
  205.      * @Expose
  206.      * @Gedmo\Versioned
  207.      */
  208.     private $apiToken;
  209.     /**
  210.      * @ORM\Column(name="clinic_type", type="string", length=255, nullable=true)
  211.      * @Expose
  212.      * @Gedmo\Versioned
  213.      */
  214.     private $clinicType;
  215.     /**
  216.      * @Expose
  217.      * @ORM\ManyToOne(targetEntity="App\Entity\Clinic")
  218.      */
  219.     private $currentClinic;
  220.     /**
  221.      * @ORM\Column(name="clinic_code", type="string", length=255, nullable=true)
  222.      * @Expose
  223.      * @Gedmo\Versioned
  224.      */
  225.     private $clinicCode;
  226.     /**
  227.      * User defined clinic name - value is from user input
  228.      * @ORM\Column(name="clinic_name", type="string", length=255, nullable=true)
  229.      * @Expose
  230.      * @Gedmo\Versioned
  231.      */
  232.     private $clinicName;
  233.     /**
  234.      * @ORM\Column(name="follow_code", type="string", length=255, nullable=true)
  235.      * @Expose
  236.      * @Gedmo\Versioned
  237.      */
  238.     private $followCode;
  239.     /**
  240.      * @ORM\Column(name="referral_code", type="string", length=255, nullable=true)
  241.      * @Expose
  242.      * @Gedmo\Versioned
  243.      */
  244.     private $referralCode;
  245.     private $enableFollowCode;
  246.     /**
  247.      * @var string
  248.      * @ORM\Column(type="string", length=255, nullable=true)
  249.      * @Gedmo\Versioned
  250.      */
  251.     private $device;
  252.     /**
  253.      * @ORM\Column(name="user_type", type="string", length=255, nullable=true)
  254.      * @Expose
  255.      */
  256.     private $userType;
  257.     /**
  258.      * @ORM\ManyToOne(targetEntity="User", inversedBy="followers")
  259.      * @Expose
  260.      */
  261.     private $parent;
  262.     /**
  263.      * @ORM\OneToMany(targetEntity="User", mappedBy="parent", orphanRemoval=true, cascade={"persist", "remove"})
  264.      */
  265.     private $followers;
  266.     /**
  267.      * @var string
  268.      *
  269.      * @ORM\Column(type="string", length=40, nullable=true)
  270.      * @Expose
  271.      */
  272.     private $registrationMethod;
  273.     /**
  274.      * @ORM\Column(name="subscription_type", type="string", length=255, nullable=true)
  275.      * @Expose
  276.      */
  277.     private $subscriptionType;
  278.     /**
  279.      * @var array
  280.      * @ORM\Column(name="extra_data", type="json", nullable=true)
  281.      * @Expose
  282.      * @Gedmo\Versioned
  283.      */
  284.     private $extraData;
  285.     /**
  286.      * @var ArrayCollection | UserClinic[]
  287.      *
  288.      * @ORM\OneToMany(targetEntity="App\Entity\UserClinic", mappedBy="user")
  289.      * @Expose
  290.      */
  291.     private $clinics;
  292.     /**
  293.      * @ORM\Column(name="dob", type="date", nullable=true)
  294.      * @Gedmo\Versioned
  295.      * @Expose
  296.      */
  297.     private $dob;
  298.     /**
  299.      * @var string
  300.      *
  301.      * @ORM\Column(name="app_version", type="string", length=80, nullable=true)
  302.      * @Expose
  303.      */
  304.     private $appVersion;
  305.     /**
  306.      * @var string
  307.      *
  308.      * @ORM\Column(name="country", type="string", length=255, nullable=true)
  309.      * @Expose
  310.      */
  311.     private $country;
  312.     /**
  313.      * @var string
  314.      *
  315.      * @ORM\Column(name="region", type="string", length=255, nullable=true)
  316.      * @Expose
  317.      */
  318.     private $region;
  319.     /**
  320.      * @var string
  321.      *
  322.      * @ORM\Column(name="city", type="string", length=255, nullable=true)
  323.      * @Expose
  324.      */
  325.     private $city;
  326.     /**
  327.      * @var string
  328.      *
  329.      * @ORM\Column(name="location", type="string", length=255, nullable=true)
  330.      * @Expose
  331.      */
  332.     private $location;
  333.     /**
  334.      * @var string
  335.      *
  336.      * @ORM\Column(name="bio", type="text", nullable=true)
  337.      * @Expose
  338.      */
  339.     private $bio;
  340.     /**
  341.      * @var string
  342.      * @ORM\Column(type="string", length=20, nullable=true)
  343.      * @Expose
  344.      * @Gedmo\Versioned
  345.      */
  346.     private $active;
  347.     /**
  348.      * @var string
  349.      * @ORM\Column(type="string", length=40, nullable=true)
  350.      * @Expose
  351.      * @Gedmo\Versioned
  352.      */
  353.     private $appUsage;
  354.     /**
  355.      * @var boolean
  356.      * @ORM\Column(type="boolean")
  357.      * @Expose
  358.      * @Gedmo\Versioned
  359.      */
  360.     private $futureTreatmentReminder  false;
  361.     /**
  362.      * @var string
  363.      *
  364.      * @ORM\Column(name="custom_protocol_value", type="string", length=255, nullable=true)
  365.      * @Expose
  366.      * @Gedmo\Versioned
  367.      */
  368.     private $customProtocolValue;
  369.     /**
  370.      *  @var string
  371.      *
  372.      * @ORM\Column(name="sub_user_type", type="string", length=255, nullable=true)
  373.      * @Expose
  374.      * @Gedmo\Versioned
  375.      */
  376.     private $subUserType self::USER_SUB_USER_TYPE_INACTIVE;
  377.     /**
  378.      *  @var string
  379.      *
  380.      * @ORM\Column(name="fcmid", type="text", nullable=true)
  381.      */
  382.     private $fcmId;
  383.     /**
  384.      * @Vich\UploadableField(mapping="user_image", fileNameProperty="imageName")
  385.      *
  386.      * @var File
  387.      */
  388.     private $imageFile;
  389.     /**
  390.      * @ORM\Column(type="string", length=255, nullable=true)
  391.      * @Expose
  392.      *
  393.      * @var string
  394.      */
  395.     private $imageName;
  396.     /**
  397.      * @var boolean
  398.      * @ORM\Column(type="boolean")
  399.      * @Expose
  400.      */
  401.     private $tutorialMain  false;
  402.     /**
  403.      * @var boolean
  404.      * @ORM\Column(type="boolean")
  405.      * @Expose
  406.      */
  407.     private $tutorialCommunity  false;
  408.     /**
  409.      * @var boolean
  410.      * @ORM\Column(type="boolean")
  411.      * @Expose
  412.      */
  413.     private $communityWelcomeScreenViewed false;
  414.     /**
  415.      * @var boolean
  416.      * @ORM\Column(type="boolean")
  417.      * @Expose
  418.      */
  419.     private $personalBoardWelcomeScreenViewed false;
  420.     /**
  421.      * Random string sent to the user email/sms address in order to verify it.
  422.      *
  423.      * @var string|null
  424.      * @ORM\Column(name="confirmation_token", type="string", length=180, unique=true, nullable=true)
  425.      * @Expose
  426.      */
  427.     protected $confirmationToken;
  428.     /**
  429.      * @var \DateTime|null
  430.      * @ORM\Column(name="last_login", type="datetime", nullable=true)
  431.      */
  432.     protected $lastLogin;
  433.     /**
  434.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  435.      */
  436.     private $deletedAt;
  437.     /**
  438.      * @var string|null
  439.      * @ORM\Column(name="mixpanel_distinct_id", type="string", length=255, nullable=true)
  440.      */
  441.     private $mixpanelDistinctId;
  442.     /**
  443.      * @var string|null
  444.      * @ORM\Column(name="already_have_hair_transplant", type="string", length=20, nullable=true)
  445.      */
  446.     private $alreadyHaveHairTransplant;
  447.     /**
  448.      * @var string|null
  449.      * @ORM\Column(name="new_treatment_protocol_start_date", type="datetime", nullable=true)
  450.      */
  451.     private $newTreatmentProtocolStartDate;
  452.     /**
  453.      * @ORM\OneToOne(targetEntity="App\Entity\Patient")
  454.      */
  455.     private $patient;
  456.     /**
  457.      * @var \App\Entity\UserContentBlockHistory
  458.      * @ORM\OneToMany(targetEntity="App\Entity\UserContentBlockHistory", mappedBy="user")
  459.      * @ORM\OrderBy({"created": "DESC"})
  460.      * @Expose
  461.      */
  462.     private $contentBlockHistories;
  463.     /**
  464.      * @ORM\OneToMany(targetEntity="App\Entity\Picture", mappedBy="user")
  465.      */
  466.     private $pictures;
  467.     /**
  468.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  469.      * @Serializer\Type("Relation")
  470.      */
  471.     private $referredBy;
  472.     /**
  473.      * @var string
  474.      *
  475.      * @ORM\Column(name="locale", type="string", length=10, nullable=true)
  476.      * @Expose
  477.      */
  478.     private $locale;
  479.     /**
  480.      * @var string
  481.      *
  482.      * @ORM\Column(name="source", type="string", length=100, nullable=true)
  483.      * @Expose
  484.      */
  485.     private $source;
  486.     /**
  487.      * @var boolean
  488.      * @ORM\Column(type="boolean")
  489.      * @Expose
  490.      */
  491.     private $membership false;
  492.     use CreatedUpdatedTrait;
  493.     public function __construct()
  494.     {
  495.         $this->salt base_convert(sha1(uniqid(mt_rand(), true)), 1636);
  496.         $this->followers = new ArrayCollection();
  497.         $this->treatmentsForms = new ArrayCollection();
  498.     }
  499.     public function __toString()
  500.     {
  501.         return (string) $this->name;
  502.     }
  503.     public function getId(): ?int
  504.     {
  505.         return $this->id;
  506.     }
  507.     /**
  508.      * @return mixed
  509.      */
  510.     public function getName()
  511.     {
  512.         return $this->name;
  513.     }
  514.     /**
  515.      * @param mixed $name
  516.      */
  517.     public function setName($name): void
  518.     {
  519.         $this->name $name;
  520.     }
  521.     /**
  522.      * @return mixed
  523.      */
  524.     public function getGender()
  525.     {
  526.         return $this->gender;
  527.     }
  528.     /**
  529.      * @param mixed $gender
  530.      */
  531.     public function setGender($gender): void
  532.     {
  533.         $this->gender $gender;
  534.     }
  535.     public function getEmail(): ?string
  536.     {
  537.         return $this->email;
  538.     }
  539.     public function setEmail(string $email): self
  540.     {
  541.         $this->email $email;
  542.         return $this;
  543.     }
  544.     /**
  545.      * @return mixed
  546.      */
  547.     public function getPhone()
  548.     {
  549.         return $this->phone;
  550.     }
  551.     /**
  552.      * @param mixed $phone
  553.      */
  554.     public function setPhone($phone): void
  555.     {
  556.         $this->phone $phone;
  557.     }
  558.     /**
  559.      * @return mixed
  560.      */
  561.     public function getFirebaseId()
  562.     {
  563.         return $this->firebaseId;
  564.     }
  565.     /**
  566.      * @param mixed $firebaseId
  567.      */
  568.     public function setFirebaseId($firebaseId): void
  569.     {
  570.         $this->firebaseId $firebaseId;
  571.     }
  572.     /**
  573.      * A visual identifier that represents this user.
  574.      *
  575.      * @see UserInterface
  576.      */
  577.     public function getUsername(): string
  578.     {
  579.         return (string) $this->email;
  580.     }
  581.     /**
  582.      * @see UserInterface
  583.      */
  584.     public function getRoles(): array
  585.     {
  586.         $roles $this->roles;
  587.         // guarantee every user at least has ROLE_USER
  588.         $roles[] = 'ROLE_USER';
  589.         return array_unique($roles);
  590.     }
  591.     public function setRoles(array $roles): self
  592.     {
  593.         $this->roles $roles;
  594.         return $this;
  595.     }
  596.     /**
  597.      * @see UserInterface
  598.      */
  599.     public function getPassword(): string
  600.     {
  601.         return (string) $this->password;
  602.     }
  603.     public function setPassword(string $password): self
  604.     {
  605.         $this->password $password;
  606.         return $this;
  607.     }
  608.     /**
  609.      * @return string
  610.      */
  611.     public function getPlainPassword(): ?string
  612.     {
  613.         return $this->plainPassword;
  614.     }
  615.     /**
  616.      * @param string $plainPassword
  617.      */
  618.     public function setPlainPassword(string $plainPassword): void
  619.     {
  620.         $this->plainPassword $plainPassword;
  621.     }
  622.     /**
  623.      * @return string|void|null
  624.      */
  625.     public function getSalt()
  626.     {
  627.         $this->salt;
  628.     }
  629.     /**
  630.      * @see UserInterface
  631.      */
  632.     public function eraseCredentials()
  633.     {
  634.         // If you store any temporary, sensitive data on the user, clear it here
  635.         // $this->plainPassword = null;
  636.     }
  637.     /**
  638.      * @return bool
  639.      */
  640.     public function isConfirmed(): bool
  641.     {
  642.         return $this->confirmed;
  643.     }
  644.     /**
  645.      * @param bool $confirmed
  646.      */
  647.     public function setConfirmed(bool $confirmed): void
  648.     {
  649.         $this->confirmed $confirmed;
  650.     }
  651.     /**
  652.      * @return bool
  653.      */
  654.     public function isEnabled(): bool
  655.     {
  656.         return $this->enabled;
  657.     }
  658.     /**
  659.      * @param bool $enabled
  660.      */
  661.     public function setEnabled(bool $enabled): void
  662.     {
  663.         $this->enabled $enabled;
  664.     }
  665.     /**
  666.      * @return bool
  667.      */
  668.     public function isNotificationEnabled(): bool
  669.     {
  670.         return $this->notificationEnabled;
  671.     }
  672.     /**
  673.      * @param bool $notificationEnabled
  674.      */
  675.     public function setNotificationEnabled(bool $notificationEnabled): void
  676.     {
  677.         $this->notificationEnabled $notificationEnabled;
  678.     }
  679.     /**
  680.      * @return \DateTime
  681.      */
  682.     public function getDisabledAt(): ?\DateTime
  683.     {
  684.         return $this->disabledAt;
  685.     }
  686.     /**
  687.      * @param \DateTime $disabledAt
  688.      */
  689.     public function setDisabledAt($disabledAt): void
  690.     {
  691.         $this->disabledAt $disabledAt;
  692.     }
  693.     /**
  694.      * @return mixed
  695.      */
  696.     public function getApiToken()
  697.     {
  698.         return $this->apiToken;
  699.     }
  700.     /**
  701.      * @param mixed $apiToken
  702.      */
  703.     public function setApiToken($apiToken): void
  704.     {
  705.         $this->apiToken $apiToken;
  706.     }
  707.     /**
  708.      * @return mixed
  709.      */
  710.     public function getClinicType()
  711.     {
  712.         return $this->clinicType;
  713.     }
  714.     /**
  715.      * @param mixed $clinicType
  716.      */
  717.     public function setClinicType($clinicType): void
  718.     {
  719.         $this->clinicType $clinicType;
  720.     }
  721.     /**
  722.      * @return mixed
  723.      */
  724.     public function getExtraData()
  725.     {
  726.         return $this->extraData;
  727.     }
  728.     /**
  729.      * @param mixed $extraData
  730.      */
  731.     public function setExtraData($extraData): void
  732.     {
  733.         $this->extraData $extraData;
  734.     }
  735.     /**
  736.      * @return mixed
  737.      */
  738.     public function getClinicCode()
  739.     {
  740.         return $this->clinicCode;
  741.     }
  742.     /**
  743.      * @param mixed $clinicCode
  744.      */
  745.     public function setClinicCode($clinicCode): void
  746.     {
  747.         $this->clinicCode $clinicCode;
  748.     }
  749.     /**
  750.      * @return mixed
  751.      */
  752.     public function getClinicName()
  753.     {
  754.         return $this->clinicName;
  755.     }
  756.     /**
  757.      * @param mixed $clinicName
  758.      */
  759.     public function setClinicName($clinicName): void
  760.     {
  761.         $this->clinicName $clinicName;
  762.     }
  763.     /**
  764.      * @return string
  765.      */
  766.     public function getDevice()
  767.     {
  768.         return $this->device;
  769.     }
  770.     /**
  771.      * @param string $device
  772.      */
  773.     public function setDevice($device): void
  774.     {
  775.         $this->device $device;
  776.     }
  777.     /**
  778.      * @return mixed
  779.      */
  780.     public function getFollowCode()
  781.     {
  782.         return $this->followCode;
  783.     }
  784.     /**
  785.      * @param mixed $followCode
  786.      */
  787.     public function setFollowCode($followCode): void
  788.     {
  789.         $this->followCode $followCode;
  790.     }
  791.     /**
  792.      * @return mixed
  793.      */
  794.     public function getReferralCode()
  795.     {
  796.         return $this->referralCode;
  797.     }
  798.     /**
  799.      * @param mixed $referralCode
  800.      */
  801.     public function setReferralCode($referralCode): void
  802.     {
  803.         $this->referralCode $referralCode;
  804.     }
  805.     /**
  806.      * @return mixed
  807.      */
  808.     public function getEnableFollowCode()
  809.     {
  810.         return $this->enableFollowCode;
  811.     }
  812.     /**
  813.      * @param mixed $enableFollowCode
  814.      */
  815.     public function setEnableFollowCode($enableFollowCode): void
  816.     {
  817.         $this->enableFollowCode $enableFollowCode;
  818.     }
  819.     /**
  820.      * @return mixed
  821.      */
  822.     public function getUserType()
  823.     {
  824.         return $this->userType;
  825.     }
  826.     /**
  827.      * @param mixed $userType
  828.      */
  829.     public function setUserType($userType): void
  830.     {
  831.         $this->userType $userType;
  832.     }
  833.     /**
  834.      * @return mixed
  835.      */
  836.     public function getParent()
  837.     {
  838.         return $this->parent;
  839.     }
  840.     /**
  841.      * @param mixed $parent
  842.      */
  843.     public function setParent($parent): void
  844.     {
  845.         $this->parent $parent;
  846.     }
  847.     /**
  848.      * @return mixed
  849.      */
  850.     public function getFollowers()
  851.     {
  852.         return $this->followers;
  853.     }
  854.     /**
  855.      * @param mixed $followers
  856.      */
  857.     public function setFollowers($followers): void
  858.     {
  859.         $this->followers $followers;
  860.     }
  861.     /**
  862.      * @return string
  863.      */
  864.     public function getRegistrationMethod(): ?string
  865.     {
  866.         return $this->registrationMethod;
  867.     }
  868.     /**
  869.      * @param string $registrationMethod
  870.      */
  871.     public function setRegistrationMethod(string $registrationMethod): void
  872.     {
  873.         $this->registrationMethod $registrationMethod;
  874.     }
  875.     /**
  876.      * @return mixed
  877.      */
  878.     public function getCurrentClinic()
  879.     {
  880.         return $this->currentClinic;
  881.     }
  882.     /**
  883.      * @param mixed $currentClinic
  884.      */
  885.     public function setCurrentClinic($currentClinic): void
  886.     {
  887.         $this->currentClinic $currentClinic;
  888.     }
  889.     /**
  890.      * @return mixed
  891.      */
  892.     public function getSubscriptionType()
  893.     {
  894.         return $this->subscriptionType;
  895.     }
  896.     /**
  897.      * @param mixed $subscriptionType
  898.      */
  899.     public function setSubscriptionType($subscriptionType): void
  900.     {
  901.         $this->subscriptionType $subscriptionType;
  902.     }
  903.     /**
  904.      * @return mixed
  905.      */
  906.     public function getDob()
  907.     {
  908.         return $this->dob;
  909.     }
  910.     /**
  911.      * @param mixed $dob
  912.      */
  913.     public function setDob($dob): void
  914.     {
  915.         $this->dob $dob;
  916.     }
  917.     /**
  918.      * @return string
  919.      */
  920.     public function getAppVersion(): ?string
  921.     {
  922.         return $this->appVersion;
  923.     }
  924.     /**
  925.      * @param string $appVersion
  926.      */
  927.     public function setAppVersion(?string $appVersion): void
  928.     {
  929.         $this->appVersion $appVersion;
  930.     }
  931.     /**
  932.      * @return string
  933.      */
  934.     public function getCountry(): ?string
  935.     {
  936.         return $this->country;
  937.     }
  938.     /**
  939.      * @param string $country
  940.      */
  941.     public function setCountry(?string $country): void
  942.     {
  943.         $this->country $country;
  944.     }
  945.     /**
  946.      * @return string
  947.      */
  948.     public function getRegion(): ?string
  949.     {
  950.         return $this->region;
  951.     }
  952.     /**
  953.      * @param string $region
  954.      */
  955.     public function setRegion(?string $region): void
  956.     {
  957.         $this->region $region;
  958.     }
  959.     /**
  960.      * @return string
  961.      */
  962.     public function getCity(): ?string
  963.     {
  964.         return $this->city;
  965.     }
  966.     /**
  967.      * @param string $city
  968.      */
  969.     public function setCity(?string $city): void
  970.     {
  971.         $this->city $city;
  972.     }
  973.     /**
  974.      * @return string
  975.      */
  976.     public function getLocation(): ?string
  977.     {
  978.         return $this->location;
  979.     }
  980.     /**
  981.      * @param string $location
  982.      */
  983.     public function setLocation(?string $location): void
  984.     {
  985.         $this->location $location;
  986.     }
  987.     /**
  988.      * @return string
  989.      */
  990.     public function getBio(): ?string
  991.     {
  992.         return $this->bio;
  993.     }
  994.     /**
  995.      * @param string $bio
  996.      */
  997.     public function setBio(?string $bio): void
  998.     {
  999.         $this->bio $bio;
  1000.     }
  1001.     /**
  1002.      * @return bool
  1003.      */
  1004.     public function getActive(): ?string
  1005.     {
  1006.         return $this->active;
  1007.     }
  1008.     /**
  1009.      * @param string $active
  1010.      */
  1011.     public function setActive(?string $active): void
  1012.     {
  1013.         $this->active $active;
  1014.     }
  1015.     /**
  1016.      * @return string
  1017.      */
  1018.     public function getAppUsage(): ?string
  1019.     {
  1020.         return $this->appUsage;
  1021.     }
  1022.     /**
  1023.      * @param string $appUsage
  1024.      */
  1025.     public function setAppUsage(?string $appUsage): void
  1026.     {
  1027.         $this->appUsage $appUsage;
  1028.     }
  1029.     /**
  1030.      * @return \DateTime
  1031.      */
  1032.     public function getFertilityStartDate(): ?\DateTime
  1033.     {
  1034.         return $this->fertilityStartDate;
  1035.     }
  1036.     /**
  1037.      * @param \DateTime $fertilityStartDate
  1038.      */
  1039.     public function setFertilityStartDate(?\DateTime $fertilityStartDate): void
  1040.     {
  1041.         $this->fertilityStartDate $fertilityStartDate;
  1042.     }
  1043.     /**
  1044.      * @return bool
  1045.      */
  1046.     public function isFutureTreatmentReminder(): ?bool
  1047.     {
  1048.         return $this->futureTreatmentReminder;
  1049.     }
  1050.     /**
  1051.      * @param bool $futureTreatmentReminder
  1052.      */
  1053.     public function setFutureTreatmentReminder(?bool $futureTreatmentReminder): void
  1054.     {
  1055.         $this->futureTreatmentReminder $futureTreatmentReminder;
  1056.     }
  1057.     /**
  1058.      * @return string
  1059.      */
  1060.     public function getSubUserType(): ?string
  1061.     {
  1062.         return $this->subUserType;
  1063.     }
  1064.     /**
  1065.      * @param string $subUserType
  1066.      */
  1067.     public function setSubUserType(?string $subUserType): void
  1068.     {
  1069.         $this->subUserType $subUserType;
  1070.     }
  1071.     /**
  1072.      * @return string
  1073.      */
  1074.     public function getFcmId(): ?string
  1075.     {
  1076.         return $this->fcmId;
  1077.     }
  1078.     /**
  1079.      * @param string $fcmId
  1080.      */
  1081.     public function setFcmId(?string $fcmId): void
  1082.     {
  1083.         $this->fcmId $fcmId;
  1084.     }
  1085.     /**
  1086.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  1087.      * of 'UploadedFile' is injected into this setter to trigger the  update. If this
  1088.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  1089.      * must be able to accept an instance of 'File' as the bundle will inject one here
  1090.      * during Doctrine hydration.
  1091.      *
  1092.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
  1093.      */
  1094.     public function setImageFile(File $image null)
  1095.     {
  1096.         $this->imageFile $image;
  1097.         if ($image) {
  1098.             // It is required that at least one field changes if you are using doctrine
  1099.             // otherwise the event listeners won't be called and the file is lost
  1100.             $this->updated = new \DateTime('now');
  1101.         }
  1102.     }
  1103.     /**
  1104.      * @return File
  1105.      */
  1106.     public function getImageFile()
  1107.     {
  1108.         return $this->imageFile;
  1109.     }
  1110.     /**
  1111.      * @param string $imageName
  1112.      */
  1113.     public function setImageName($imageName)
  1114.     {
  1115.         $this->imageName $imageName;
  1116.     }
  1117.     /**
  1118.      * @return string
  1119.      */
  1120.     public function getImageName()
  1121.     {
  1122.         return $this->imageName;
  1123.     }
  1124.     /**
  1125.      * @return bool
  1126.      */
  1127.     public function isTutorialMain(): ?bool
  1128.     {
  1129.         return $this->tutorialMain;
  1130.     }
  1131.     /**
  1132.      * @param bool $tutorialMain
  1133.      */
  1134.     public function setTutorialMain(?bool $tutorialMain): void
  1135.     {
  1136.         $this->tutorialMain $tutorialMain;
  1137.     }
  1138.     /**
  1139.      * @return bool
  1140.      */
  1141.     public function isTutorialCommunity(): ?bool
  1142.     {
  1143.         return $this->tutorialCommunity;
  1144.     }
  1145.     /**
  1146.      * @param bool $tutorialCommunity
  1147.      */
  1148.     public function setTutorialCommunity(?bool $tutorialCommunity): void
  1149.     {
  1150.         $this->tutorialCommunity $tutorialCommunity;
  1151.     }
  1152.     public function isCommunityWelcomeScreenViewed(){
  1153.         return $this->communityWelcomeScreenViewed;
  1154.     }
  1155.     public function setCommunityWelcomeScreenViewed($communityWelcomeScreenViewed){
  1156.         $this->communityWelcomeScreenViewed $communityWelcomeScreenViewed;
  1157.     }
  1158.     /**
  1159.      * @return bool
  1160.      */
  1161.     public function isPersonalBoardWelcomeScreenViewed(): ?bool
  1162.     {
  1163.         return $this->personalBoardWelcomeScreenViewed;
  1164.     }
  1165.     /**
  1166.      * @param bool $personalBoardWelcomeScreenViewed
  1167.      */
  1168.     public function setPersonalBoardWelcomeScreenViewed(?bool $personalBoardWelcomeScreenViewed): void
  1169.     {
  1170.         $this->personalBoardWelcomeScreenViewed $personalBoardWelcomeScreenViewed;
  1171.     }
  1172.     /**
  1173.      * @return string|null
  1174.      */
  1175.     public function getConfirmationToken(): ?string
  1176.     {
  1177.         return $this->confirmationToken;
  1178.     }
  1179.     /**
  1180.      * @param string|null $confirmationToken
  1181.      */
  1182.     public function setConfirmationToken(?string $confirmationToken): void
  1183.     {
  1184.         $this->confirmationToken $confirmationToken;
  1185.     }
  1186.     /**
  1187.      * @return \DateTime|null
  1188.      */
  1189.     public function getLastLogin(): ?\DateTime
  1190.     {
  1191.         return $this->lastLogin;
  1192.     }
  1193.     /**
  1194.      * @param \DateTime|null $lastLogin
  1195.      */
  1196.     public function setLastLogin(?\DateTime $lastLogin): void
  1197.     {
  1198.         $this->lastLogin $lastLogin;
  1199.     }
  1200.     /**
  1201.      * @return mixed
  1202.      */
  1203.     public function getDeletedAt()
  1204.     {
  1205.         return $this->deletedAt;
  1206.     }
  1207.     /**
  1208.      * @param mixed $deletedAt
  1209.      */
  1210.     public function setDeletedAt($deletedAt): void
  1211.     {
  1212.         $this->deletedAt $deletedAt;
  1213.     }
  1214.     /**
  1215.      * @return string|null
  1216.      */
  1217.     public function getMixpanelDistinctId(): ?string
  1218.     {
  1219.         return $this->mixpanelDistinctId;
  1220.     }
  1221.     /**
  1222.      * @param string|null $mixpanelDistinctId
  1223.      */
  1224.     public function setMixpanelDistinctId(?string $mixpanelDistinctId): void
  1225.     {
  1226.         $this->mixpanelDistinctId $mixpanelDistinctId;
  1227.     }
  1228.     /**
  1229.      * @return string|null
  1230.      */
  1231.     public function getAlreadyHaveHairTransplant(): ?string
  1232.     {
  1233.         return $this->alreadyHaveHairTransplant;
  1234.     }
  1235.     /**
  1236.      * @param string|null $alreadyHaveHairTransplant
  1237.      */
  1238.     public function setAlreadyHaveHairTransplant(?string $alreadyHaveHairTransplant): void
  1239.     {
  1240.         $this->alreadyHaveHairTransplant $alreadyHaveHairTransplant;
  1241.     }
  1242.     /**
  1243.      * @return string|null
  1244.      */
  1245.     public function getNewTreatmentProtocolStartDate(): ?string
  1246.     {
  1247.         return $this->newTreatmentProtocolStartDate;
  1248.     }
  1249.     /**
  1250.      * @param string|null $newTreatmentProtocolStartDate
  1251.      */
  1252.     public function setNewTreatmentProtocolStartDate(?string $newTreatmentProtocolStartDate): void
  1253.     {
  1254.         $this->newTreatmentProtocolStartDate $newTreatmentProtocolStartDate;
  1255.     }
  1256.     /**
  1257.      * @return mixed
  1258.      */
  1259.     public function getPatient()
  1260.     {
  1261.         return $this->patient;
  1262.     }
  1263.     /**
  1264.      * @param mixed $patient
  1265.      */
  1266.     public function setPatient($patient): void
  1267.     {
  1268.         $this->patient $patient;
  1269.     }
  1270.     public function getContentBlockHistories(){
  1271.         return $this->contentBlockHistories;
  1272.     }
  1273.     private $treatment;
  1274.     /**
  1275.      * @ORM\OneToMany(targetEntity=TreatmentsForm::class, mappedBy="user")
  1276.      */
  1277.     private $treatmentsForms;
  1278.     /**
  1279.      * @Serializer\VirtualProperty()
  1280.      * @Serializer\SerializedName("treatment")
  1281.      * @Serializer\Expose
  1282.      */
  1283.     public function getTreatment()
  1284.     {
  1285.         return $this->patient $this->patient->getTreatment() : null;
  1286.     }
  1287.     public function getPictures()
  1288.     {
  1289.         return $this->pictures;
  1290.     }
  1291.     /**
  1292.      * @return mixed
  1293.      */
  1294.     public function getReferredBy()
  1295.     {
  1296.         return $this->referredBy;
  1297.     }
  1298.     /**
  1299.      * @param mixed $referredBy
  1300.      */
  1301.     public function setReferredBy($referredBy): void
  1302.     {
  1303.         $this->referredBy $referredBy;
  1304.     }
  1305.     /**
  1306.      * @return string
  1307.      */
  1308.     public function getLocale(): ?string
  1309.     {
  1310.         return $this->locale;
  1311.     }
  1312.     /**
  1313.      * @param string $locale
  1314.      */
  1315.     public function setLocale(?string $locale): void
  1316.     {
  1317.         $this->locale $locale;
  1318.     }
  1319.     /**
  1320.      * @return string
  1321.      */
  1322.     public function getSource(): ?string
  1323.     {
  1324.         return $this->source;
  1325.     }
  1326.     /**
  1327.      * @param string $source
  1328.      */
  1329.     public function setSource(?string $source): void
  1330.     {
  1331.         $this->source $source;
  1332.     }
  1333.     /**
  1334.      * @return bool
  1335.      */
  1336.     public function isMembership(): ?bool
  1337.     {
  1338.         return $this->membership;
  1339.     }
  1340.     /**
  1341.      * @param bool $membership
  1342.      */
  1343.     public function setMembership(?bool $membership): void
  1344.     {
  1345.         $this->membership $membership;
  1346.     }
  1347.     /**
  1348.      * @return Collection<int, TreatmentsForm>
  1349.      */
  1350.     public function getTreatmentsForms(): Collection
  1351.     {
  1352.         return $this->treatmentsForms;
  1353.     }
  1354.     public function addTreatmentsForm(TreatmentsForm $treatmentsForm): self
  1355.     {
  1356.         if (!$this->treatmentsForms->contains($treatmentsForm)) {
  1357.             $this->treatmentsForms[] = $treatmentsForm;
  1358.             $treatmentsForm->setUser($this);
  1359.         }
  1360.         return $this;
  1361.     }
  1362.     public function removeTreatmentsForm(TreatmentsForm $treatmentsForm): self
  1363.     {
  1364.         if ($this->treatmentsForms->removeElement($treatmentsForm)) {
  1365.             // set the owning side to null (unless already changed)
  1366.             if ($treatmentsForm->getUser() === $this) {
  1367.                 $treatmentsForm->setUser(null);
  1368.             }
  1369.         }
  1370.         return $this;
  1371.     }
  1372. }