app/Entity/Schema/ORM/Member.php line 26

Open in your IDE?
  1. <?php
  2. namespace Sq\Entity\Schema\ORM;
  3. // This is for the @ORM\ annotation namespacing.
  4. use Carbon\Carbon;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping AS ORM;
  8. use Sq\Entity\Schema\Column\MemberRole;
  9. use Sq\Entity\Schema\Column\MemberSuspended;
  10. /**
  11.  * Member.
  12.  */
  13. #[ORM\Entity(repositoryClass\Sq\Service\Repository\ORM\MemberRepository::class)]
  14. #[ORM\Table(name'member')]
  15. #[ORM\Index(name'm_date_joined'columns: ['m_date_joined'])]
  16. #[ORM\Index(name'm_last_updated'columns: ['m_last_updated'])]
  17. #[ORM\Index(name'm_dob'columns: ['m_dob'])]
  18. #[ORM\Index(name'm_sex'columns: ['m_sex'])]
  19. #[ORM\Index(name'm_confirmed_suspended'columns: ['m_confirmed''m_suspended'])]
  20. #[ORM\UniqueConstraint(name'm_username_UNIQUE'columns: ['m_username'])]
  21. #[ORM\UniqueConstraint(name'm_email'columns: ['m_email'])]
  22. #[ORM\UniqueConstraint(name'm_display_name'columns: ['m_display_name'])]
  23. class Member
  24. {
  25.     // a member can have 2 spam strikes - on their 3rd strike, they're locked.
  26.     public const MAX_SPAM_STRIKES_ALLOWED 2;
  27.     /**
  28.      * @var int
  29.      */
  30.     #[ORM\Column(name'm_id'type'integer'nullablefalseoptions: ['unsigned' => true])]
  31.     #[ORM\Id]
  32.     #[ORM\GeneratedValue(strategy'AUTO')]
  33.     private $id;
  34.     /**
  35.      * @var string
  36.      */
  37.     #[ORM\Column(name'm_username'type'string'length45nullablefalse)]
  38.     private $username;
  39.     /**
  40.      * @var string|null
  41.      */
  42.     #[ORM\Column(name'm_display_name'type'string'length45nullabletrue)]
  43.     private $displayName;
  44.     /**
  45.      * @var string|null
  46.      */
  47.     #[ORM\Column(name'm_demographic'type'string'length32nullabletrue)]
  48.     private $demographic;
  49.     /**
  50.      * @var string|null
  51.      */
  52.     #[ORM\Column(name'm_first_name'type'string'length45nullabletrue)]
  53.     private $firstName;
  54.     /**
  55.      * @var string|null
  56.      */
  57.     #[ORM\Column(name'm_bill_first_name'type'string'length64nullabletrue)]
  58.     private $billFirstName;
  59.     /**
  60.      * @var string|null
  61.      */
  62.     #[ORM\Column(name'm_bill_last_name'type'string'length64nullabletrue)]
  63.     private $billLastName;
  64.     /**
  65.      * @var string|null
  66.      */
  67.     #[ORM\Column(name'm_bill_email'type'binary_aes_encrypted'nullabletrue)]
  68.     private $billEmail;
  69.     /**
  70.      * @var string|null
  71.      */
  72.     #[ORM\Column(name'm_company'type'string'length64nullabletrue)]
  73.     private $company;
  74.     /**
  75.      * @var string|null
  76.      */
  77.     #[ORM\Column(name'm_website'type'string'length255nullabletrue)]
  78.     private $website;
  79.     /**
  80.      * @var string|null
  81.      */
  82.     #[ORM\Column(name'm_bill_country_code'type'string'length2nullabletrue)]
  83.     private $billCountryCode;
  84.     /**
  85.      * @var \DateTime|null
  86.      */
  87.     #[ORM\Column(name'm_dob'type'date'nullabletrue)]
  88.     private $dob;
  89.     /**
  90.      * @var string|null
  91.      */
  92.     #[ORM\Column(name'm_sex'type'string'length1nullabletrue)]
  93.     private $sex;
  94.     /**
  95.      * @var bool
  96.      */
  97.     #[ORM\Column(name'm_legacy_signup'type'boolean'nullablefalse)]
  98.     private $legacySignup false;
  99.     /**
  100.      * @var bool
  101.      */
  102.     #[ORM\Column(name'm_in_overhaul'type'boolean'nullablefalse)]
  103.     private $inOverhaul false;
  104.     /**
  105.      * @var bool
  106.      */
  107.     #[ORM\Column(name'm_allow_rollback'type'boolean'nullablefalseoptions: ['default' => '0'])]
  108.     private $allowRollbackToLegacy false;
  109.     /**
  110.      * @var \DateTime|null
  111.      */
  112.     #[ORM\Column(name'm_date_last_migrated'type'datetime'nullabletrue)]
  113.     private $dateLastMigrated;
  114.     /**
  115.      * @var int|null
  116.      */
  117.     #[ORM\Column(name'm_role'type'integer'nullabletrue)]
  118.     private $role MemberRole::MEMBER;
  119.     /**
  120.      * @var bool|null
  121.      */
  122.     #[ORM\Column(name'm_confirmed'type'boolean'nullabletrue)]
  123.     private $confirmed false;
  124.     /**
  125.      * @var string
  126.      *
  127.      * @deprecated
  128.      */
  129.     #[ORM\Column(name'm_plan'type'string'length0nullablefalseoptions: ['default' => 'free'])]
  130.     private $deprecatedPlan 'free';
  131.     /**
  132.      * @var Plan
  133.      */
  134.     #[ORM\ManyToOne(targetEntityPlan::class)]
  135.     #[ORM\JoinColumn(name'm_plan_id'referencedColumnName'plan_id'nullablefalse)]
  136.     private $plan;
  137.     /**
  138.      * @var int|null
  139.      */
  140.     #[ORM\Column(name'm_plan_group'type'smallint'nullabletrueoptions: ['default' => '3''unsigned' => true])]
  141.     private $planGroup 4;
  142.     /**
  143.      * @var int|null
  144.      */
  145.     #[ORM\Column(name'm_addon_group'type'smallint'nullabletrueoptions: ['default' => '1''unsigned' => true])]
  146.     private $addonGroup 2;
  147.     /**
  148.      * @var bool|null
  149.      */
  150.     #[ORM\Column(name'm_custom_plans'type'boolean'nullabletrueoptions: ['default' => '1'])]
  151.     private $customPlans true;
  152.     /**
  153.      * @var bool|null
  154.      */
  155.     #[ORM\Column(name'm_ab_lite_plan'type'boolean'nullabletrueoptions: ['default' => '0'])]
  156.     private $litePlanAvailable false;
  157.     /**
  158.      * @var int|null
  159.      */
  160.     #[ORM\Column(name'm_home_design'type'integer'nullabletrueoptions: ['unsigned' => true])]
  161.     private $homeDesign 11;
  162.     /**
  163.      * @var int|null
  164.      */
  165.     #[ORM\Column(name'm_onboarding'type'smallint'nullabletrueoptions: ['default' => 1])]
  166.     private $onboarding 1;
  167.     /**
  168.      * @var bool|null
  169.      */
  170.     #[ORM\Column(name'm_early_upgrade_offer'type'boolean'nullabletrueoptions: ['default' => '0'])]
  171.     private $earlyUpgradeOffer false;
  172.     /**
  173.      * @var string|null
  174.      */
  175.     #[ORM\Column(name'm_trial_plan'type'string'length255nullabletrue)]
  176.     private $trialPlan;
  177.     /**
  178.      * @var int|null
  179.      */
  180.     #[ORM\Column(name'm_pricing_design'type'integer'nullabletrueoptions: ['default' => 1])]
  181.     private $pricingDesign 2;
  182.     /**
  183.      * @var string
  184.      */
  185.     #[ORM\Column(name'm_billing_cycle'type'string'length0nullablefalseoptions: ['default' => 'monthly'])]
  186.     private $billingCycle 'monthly';
  187.     /**
  188.      * @var string|null
  189.      */
  190.     #[ORM\Column(name'm_currency'type'string'length3nullabletrue)]
  191.     private $currency;
  192.     /**
  193.      * @var string|null
  194.      */
  195.     #[ORM\Column(name'm_balance'type'decimal'precision15scale2nullabletrueoptions: ['default' => '0.00'])]
  196.     private $balance '0.00';
  197.     /**
  198.      * @var string|null
  199.      */
  200.     #[ORM\Column(name'm_subscription_id'type'string'length36nullabletrue)]
  201.     private $subscriptionId;
  202.     /**
  203.      * @var string|null
  204.      */
  205.     #[ORM\Column(name'm_sub_status'type'string'length0nullabletrueoptions: ['default' => 'trial'])]
  206.     private $subStatus 'trial';
  207.     /**
  208.      * @var \DateTimeInterface|null
  209.      */
  210.     #[ORM\Column(name'm_trial_expiry_local_date'type'localdate'nullabletrue)]
  211.     private $trialExpiryLocalDate;
  212.     /**
  213.      * @var \DateTime|null
  214.      */
  215.     #[ORM\Column(name'm_next_billing_date'type'date'nullabletrue)]
  216.     private $nextBillingDate;
  217.     /**
  218.      * @var string|null
  219.      */
  220.     #[ORM\Column(name'm_next_bill_amount'type'decimal'precision8scale2nullabletrueoptions: ['default' => '0.00'])]
  221.     private $nextBillAmount '0.00';
  222.     /**
  223.      * @deprecated
  224.      *
  225.      * @var int|null
  226.      */
  227.     #[ORM\Column(name'm_active'type'smallint'nullabletrue)]
  228.     private $active 1;
  229.     /**
  230.      * @deprecated
  231.      *
  232.      * @var int|null
  233.      */
  234.     #[ORM\Column(name'm_verified'type'smallint'nullabletrue)]
  235.     private $verified 0;
  236.     /**
  237.      * @var int
  238.      */
  239.     #[ORM\Column(name'm_spam_strikes'type'integer'nullablefalse)]
  240.     private $spamStrikes 0;
  241.     /**
  242.      * @var int|null
  243.      *
  244.      * @Sq\Entity\Schema\ORM\Annotation\PostUpdate(eventName="sq.suspended_post_update")
  245.      */
  246.     #[ORM\Column(name'm_suspended'type'integer'nullabletrue)]
  247.     private $suspended MemberSuspended::ACTIVE;
  248.     /**
  249.      * @var string|null
  250.      */
  251.     #[ORM\Column(name'm_admin_rating'type'string'length20nullabletrue)]
  252.     private $adminRating;
  253.     /**
  254.      * @var string|null
  255.      */
  256.     #[ORM\Column(name'm_password'type'string'length255nullabletrue)]
  257.     private $password;
  258.     /**
  259.      * @var string|null
  260.      */
  261.     #[ORM\Column(name'm_ref'type'string'length45nullabletrue)]
  262.     private $ref;
  263.     /**
  264.      * @var bool|null
  265.      */
  266.     #[ORM\Column(name'm_ref_gift'type'boolean'nullabletrue)]
  267.     private $refGift '0';
  268.     /**
  269.      * @var int|null
  270.      */
  271.     #[ORM\Column(name'm_views'type'integer'nullabletrue)]
  272.     private $views '0';
  273.     /**
  274.      * @var \DateTime|null
  275.      */
  276.     #[ORM\Column(name'm_first_visit'type'datetime'nullabletrue)]
  277.     private $firstVisit;
  278.     /**
  279.      * @var \DateTime
  280.      */
  281.     #[ORM\Column(name'm_date_joined'type'datetime'nullablefalse)]
  282.     private $dateJoined;
  283.     /**
  284.      * @var \DateTime|null
  285.      */
  286.     #[ORM\Column(name'm_date_activated'type'datetime'nullabletrue)]
  287.     private $dateActivated;
  288.     /**
  289.      * @var \DateTime
  290.      */
  291.     #[ORM\Column(name'm_last_login'type'datetime'nullablefalse)]
  292.     private $lastLogin;
  293.     /**
  294.      * @var \DateTime
  295.      */
  296.     #[ORM\Column(name'm_last_updated'type'datetime'nullablefalse)]
  297.     private $lastUpdated;
  298.     /**
  299.      * @var \DateTime|null
  300.      */
  301.     #[ORM\Column(name'm_date_featured'type'datetime'nullabletrue)]
  302.     private $dateFeatured;
  303.     /**
  304.      * @var \DateTime|null
  305.      */
  306.     #[ORM\Column(name'm_date_upgraded'type'datetime'nullabletrue)]
  307.     private $dateUpgraded;
  308.     /**
  309.      * @var \DateTime|null
  310.      */
  311.     #[ORM\Column(name'm_news_last_visited'type'datetime'nullabletrueoptions: ['default' => '2013-01-01 00:00:00'])]
  312.     private $newsLastVisited;
  313.     /**
  314.      * @var \DateTime|null
  315.      */
  316.     #[ORM\Column(name'm_notifications_last_visited'type'datetime'nullabletrueoptions: ['default' => '2013-01-01 00:00:00'])]
  317.     private $notificationsLastVisited;
  318.     /**
  319.      * @var \DateTime|null
  320.      */
  321.     #[ORM\Column(name'm_tips_last_updated'type'datetime'nullabletrue)]
  322.     private $tipsLastUpdated;
  323.     /**
  324.      * @var \DateTime|null
  325.      */
  326.     #[ORM\Column(name'm_news_feed_last_visited'type'datetime'nullabletrueoptions: ['default' => '2013-01-01 00:00:00'])]
  327.     private $newsFeedLastVisited;
  328.     /**
  329.      * @var string|null
  330.      */
  331.     #[ORM\Column(name'm_profile_photo_coords'type'string'length20nullabletrue)]
  332.     private $profilePhotoCoords;
  333.     /**
  334.      * @var string
  335.      */
  336.     #[ORM\Column(name'm_timezone'type'string'length42nullablefalseoptions: ['default' => 'UTC'])]
  337.     private $timezone 'UTC';
  338.     /**
  339.      * @var bool|null
  340.      */
  341.     #[ORM\Column(name'm_24h'type'boolean'nullabletrue)]
  342.     private $twentyFour '0';
  343.     /**
  344.      * @var \DateTime|null
  345.      */
  346.     #[ORM\Column(name'm_profile_photo_updated'type'datetime'nullabletrue)]
  347.     private $profilePhotoUpdated;
  348.     /**
  349.      * @var string|null
  350.      */
  351.     #[ORM\Column(name'm_cover_photo_coords'type'string'length20nullabletrue)]
  352.     private $coverPhotoCoords;
  353.     /**
  354.      * @var \DateTime|null
  355.      */
  356.     #[ORM\Column(name'm_cover_photo_updated'type'datetime'nullabletrue)]
  357.     private $coverPhotoUpdated;
  358.     /**
  359.      * @var string
  360.      */
  361.     #[ORM\Column(name'm_email'type'binary_aes_encrypted'nullablefalse)]
  362.     private $email '';
  363.     /**
  364.      * @var string
  365.      */
  366.     #[ORM\Column(name'm_publishing_email'type'binary_aes_encrypted'nullablefalse)]
  367.     private $publishingEmail '';
  368.     /**
  369.      * @var string|null
  370.      */
  371.     #[ORM\Column(name'm_sort_by'type'string'length0nullabletrueoptions: ['default' => 'newest_first'])]
  372.     private $sortBy 'newest_first';
  373.     /**
  374.      * @var int|null
  375.      */
  376.     #[ORM\Column(name'm_last_site_email'type'smallint'nullabletrueoptions: ['unsigned' => true])]
  377.     private $lastSiteEmail;
  378.     /**
  379.      * @var bool
  380.      */
  381.     #[ORM\Column(name'm_spam_check'type'boolean'nullablefalse)]
  382.     private $spamCheck true;
  383.     /**
  384.      * @var string|null
  385.      */
  386.     #[ORM\Column(name'm_profile_visibility'type'string'length0nullabletrueoptions: ['default' => 'public'])]
  387.     private $profileVisibility 'public';
  388.     /**
  389.      * @var string|null
  390.      */
  391.     #[ORM\Column(name'm_age_visibility'type'string'length0nullabletrueoptions: ['default' => 'public'])]
  392.     private $ageVisibility 'public';
  393.     /**
  394.      * @var string|null
  395.      */
  396.     #[ORM\Column(name'm_gender_visibility'type'string'length0nullabletrueoptions: ['default' => 'public'])]
  397.     private $genderVisibility 'public';
  398.     /**
  399.      * @var string|null
  400.      */
  401.     #[ORM\Column(name'm_nsfw_visibility'type'string'length0nullabletrueoptions: ['default' => 'public'])]
  402.     private $nsfwVisibility 'public';
  403.     /**
  404.      * @var int|null
  405.      */
  406.     #[ORM\Column(name'm_count_brands'type'smallint'nullabletrueoptions: ['unsigned' => true])]
  407.     private $countBrands;
  408.     /**
  409.      * @var int
  410.      */
  411.     #[ORM\Column(name'm_mautic_id'type'integer'nullabletrueoptions: ['unsigned' => true])]
  412.     private $mauticId;
  413.     /**
  414.      * @var \DateTime|null
  415.      */
  416.     #[ORM\Column(name'm_engagement_update'type'datetime'nullabletrue)]
  417.     private $engagementUpdate;
  418.     #[ORM\OneToOne(targetEntityAbArchive::class, mappedBy'member'cascade: ['persist'])]
  419.     private $abArchive;
  420.     #[ORM\OneToOne(targetEntityAccountSettings::class, mappedBy'member'cascade: ['persist'])]
  421.     private $accountSettings;
  422.     #[ORM\OneToOne(targetEntityMemberFlags::class, mappedBy'member'fetch'EAGER'cascade: ['persist'])]
  423.     private $flags;
  424.     #[ORM\OneToOne(targetEntityProgress::class, mappedBy'member'cascade: ['persist'])]
  425.     private $progress;
  426.     #[ORM\OneToMany(targetEntityTour::class, mappedBy'member'cascade: ['persist'])]
  427.     private $tours;
  428.     #[ORM\OneToMany(targetEntityBitly::class, mappedBy'member')]
  429.     private $bitlyAccounts;
  430.     #[ORM\OneToMany(targetEntityAndroidApp::class, mappedBy'member')]
  431.     private $androidApps;
  432.     #[ORM\OneToMany(targetEntityIosApp::class, mappedBy'member')]
  433.     private $iosApps;
  434.     #[ORM\OneToOne(targetEntityBusiness::class, mappedBy'member')]
  435.     private $business;
  436.     #[ORM\OneToOne(targetEntityUTM::class, mappedBy'member')]
  437.     private $utm;
  438.     #[ORM\OneToMany(targetEntityBookmark::class, mappedBy'member')]
  439.     private $bookmarks;
  440.     /**
  441.      * @var Collection
  442.      */
  443.     #[ORM\ManyToMany(targetEntityAddons::class)]
  444.     #[ORM\JoinTable(name'member_addons'joinColumns: [new ORM\JoinColumn(name'mao_m_id'referencedColumnName'm_id')], inverseJoinColumns: [new ORM\JoinColumn(name'mao_ao_id'referencedColumnName'ao_id')])]
  445.     private $addons;
  446.     /**
  447.      * @var Collection
  448.      */
  449.     #[ORM\OneToMany(targetEntityAdminTagAssignment::class, mappedBy'assignedTo'orphanRemovaltruecascade: ['persist'])]
  450.     private $adminTagAssignments;
  451.     /**
  452.      * @var bool
  453.      */
  454.     #[ORM\Column(name'm_email_bounced'type'boolean'nullabletrue)]
  455.     private $emailBounced false;
  456.     #[ORM\OneToOne(targetEntityLeadDynoLead::class, mappedBy'member'cascade: ['persist'])]
  457.     private $leadDynoLead;
  458.     #[ORM\OneToOne(targetEntityLeadDynoAffiliate::class, mappedBy'member'cascade: ['persist'])]
  459.     private $leadDynoAffiliate;
  460.     /**
  461.      * @deprecated Get relationships from Organization->getMember(), and Organization->getOwner()
  462.      *
  463.      * @var LegacyAlphaMap|null
  464.      */
  465.     #[ORM\OneToOne(targetEntityLegacyAlphaMap::class, mappedBy'member'cascade: ['persist'])]
  466.     private $legacyAlphaMap;
  467.     /**
  468.      * @var string|null
  469.      */
  470.     #[ORM\Column(name'm_mfa_secret'type'string'length191nullabletrue)]
  471.     private $mfaSecret;
  472.     /**
  473.      * @var Collection
  474.      */
  475.     #[ORM\OneToMany(targetEntitySocialProfile::class, mappedBy'member')]
  476.     private $socialProfiles;
  477.     /**
  478.      * @var Collection
  479.      */
  480.     #[ORM\OneToMany(targetEntityPostCategory::class, mappedBy'member')]
  481.     private $categories;
  482.     /**
  483.      * @var Organization | null
  484.      */
  485.     #[ORM\OneToOne(targetEntityOrganization::class, mappedBy'legacyMember')]
  486.     private $organization;
  487.     public function __construct(
  488.         string $username,
  489.         string $email,
  490.         string $firstName,
  491.         string $timezone,
  492.         ?string $countryCode,
  493.         string $billingCycle 'monthly',
  494.         int $trialLength 14,
  495.         ?Organization $organization null,
  496.         ?\DateTimeInterface $firstVisit null,
  497.         bool $legacySignup false,
  498.     ) {
  499.         $billingCycle $billingCycle ?: 'monthly';
  500.         if (!in_array($billingCycle, ['yearly''monthly']))
  501.         {
  502.             $billingCycle 'monthly';
  503.         }
  504.         $dateTrialExpiry Carbon::now($timezone)->addDays($trialLength);
  505.         $this->username $username;
  506.         $this->email $email;
  507.         $this->firstName $firstName;
  508.         $this->timezone $timezone;
  509.         $this->billCountryCode $countryCode;
  510.         $this->billingCycle $billingCycle;
  511.         $this->organization $organization;
  512.         $this->firstVisit $firstVisit;
  513.         $this->legacySignup $legacySignup;
  514.         $this->tours = new ArrayCollection();
  515.         $this->bitlyAccounts = new ArrayCollection();
  516.         $this->androidApps = new ArrayCollection();
  517.         $this->iosApps = new ArrayCollection();
  518.         $this->bookmarks = new ArrayCollection();
  519.         $this->addons = new ArrayCollection();
  520.         $this->adminTagAssignments = new ArrayCollection();
  521.         $this->socialProfiles = new ArrayCollection();
  522.         $this->categories = new ArrayCollection();
  523.         $this->accountSettings = new AccountSettings($thisfalsefalsefalse);
  524.         $this->trialExpiryLocalDate $dateTrialExpiry;
  525.         $this->flags = (new MemberFlags($this))->setFeatures(['twitter_v2api_basic']);
  526.         $this->progress = new Progress($this);
  527.     }
  528.     public function getId(): ?int
  529.     {
  530.         return $this->id;
  531.     }
  532.     public function getOrganization(): ?Organization
  533.     {
  534.         return $this->organization;
  535.     }
  536.     /**
  537.      * True if the legacy member was previously migrated to an overhaul user, but is back to using the Legacy.
  538.      *
  539.      * @return bool
  540.      */
  541.     public function wasOverhaulUser(): bool
  542.     {
  543.         return !$this->isInOverhaul() && $this->getDateLastMigrated() !== null;
  544.     }
  545.     /**
  546.      * @return Collection<SocialProfile>
  547.      */
  548.     public function getSocialProfiles(): Collection
  549.     {
  550.         return $this->socialProfiles->filter(function (SocialProfile $profile): bool
  551.         {
  552.             return !$profile->isDeleted();
  553.         });
  554.     }
  555.     /**
  556.      * @return Collection<PostCategory>
  557.      */
  558.     public function getCategories(): Collection
  559.     {
  560.         return $this->categories;
  561.     }
  562.     public function setUsername(string $username): self
  563.     {
  564.         $this->username $username;
  565.         return $this;
  566.     }
  567.     public function getUsername(): ?string
  568.     {
  569.         return $this->username;
  570.     }
  571.     public function getDisplayName(): ?string
  572.     {
  573.         return $this->displayName;
  574.     }
  575.     public function setDisplayName(?string $displayName): self
  576.     {
  577.         $this->displayName $displayName;
  578.         return $this;
  579.     }
  580.     public function getDemographic(): ?string
  581.     {
  582.         return $this->demographic;
  583.     }
  584.     public function setDemographic(?string $demographic): self
  585.     {
  586.         $this->demographic $demographic;
  587.         return $this;
  588.     }
  589.     public function getFirstName(): ?string
  590.     {
  591.         return $this->firstName;
  592.     }
  593.     public function setFirstName(?string $firstName): self
  594.     {
  595.         $this->firstName $firstName;
  596.         return $this;
  597.     }
  598.     public function getBillFirstName(): ?string
  599.     {
  600.         return $this->billFirstName;
  601.     }
  602.     public function setBillFirstName(?string $billFirstName): self
  603.     {
  604.         $this->billFirstName $billFirstName;
  605.         return $this;
  606.     }
  607.     public function getBillLastName(): ?string
  608.     {
  609.         return $this->billLastName;
  610.     }
  611.     public function setBillLastName(?string $billLastName): self
  612.     {
  613.         $this->billLastName $billLastName;
  614.         return $this;
  615.     }
  616.     public function getBillEmail()
  617.     {
  618.         return $this->billEmail;
  619.     }
  620.     public function setBillEmail($billEmail): self
  621.     {
  622.         $this->billEmail $billEmail;
  623.         return $this;
  624.     }
  625.     public function getCompany(): ?string
  626.     {
  627.         return $this->company;
  628.     }
  629.     public function setCompany(?string $company): self
  630.     {
  631.         $this->company $company;
  632.         return $this;
  633.     }
  634.     public function getWebsite(): ?string
  635.     {
  636.         return $this->website;
  637.     }
  638.     public function setWebsite(?string $website): self
  639.     {
  640.         $this->website $website;
  641.         return $this;
  642.     }
  643.     public function getBillCountryCode(): ?string
  644.     {
  645.         return $this->billCountryCode;
  646.     }
  647.     public function setBillCountryCode(?string $billCountryCode): self
  648.     {
  649.         $this->billCountryCode $billCountryCode;
  650.         return $this;
  651.     }
  652.     public function getDob(): ?\DateTimeInterface
  653.     {
  654.         return $this->dob;
  655.     }
  656.     public function setDob(?\DateTimeInterface $dob): self
  657.     {
  658.         $this->dob $dob;
  659.         return $this;
  660.     }
  661.     public function getSex(): ?string
  662.     {
  663.         return $this->sex;
  664.     }
  665.     public function setSex(?string $sex): self
  666.     {
  667.         $this->sex $sex;
  668.         return $this;
  669.     }
  670.     public function wasLegacySignup(): bool
  671.     {
  672.         return $this->legacySignup;
  673.     }
  674.     public function isInOverhaul(): bool
  675.     {
  676.         return $this->inOverhaul;
  677.     }
  678.     public function setInOverhaul(bool $inOverhaul): self
  679.     {
  680.         $this->inOverhaul $inOverhaul;
  681.         return $this;
  682.     }
  683.     public function canRollbackToLegacy(): bool
  684.     {
  685.         return $this->allowRollbackToLegacy;
  686.     }
  687.     public function setAllowRollbackToLegacy(bool $allowRollbackToLegacy): self
  688.     {
  689.         $this->allowRollbackToLegacy $allowRollbackToLegacy;
  690.         return $this;
  691.     }
  692.     public function getDateLastMigrated(): ?\DateTimeInterface
  693.     {
  694.         return $this->dateLastMigrated;
  695.     }
  696.     public function setDateLastMigrated(?\DateTimeInterface $dateMigrated): self
  697.     {
  698.         $this->dateLastMigrated $dateMigrated;
  699.         return $this;
  700.     }
  701.     public function getRole(): ?int
  702.     {
  703.         return $this->role;
  704.     }
  705.     public function setRole(?int $role): self
  706.     {
  707.         $this->role $role;
  708.         return $this;
  709.     }
  710.     public function getConfirmed(): ?bool
  711.     {
  712.         return $this->confirmed;
  713.     }
  714.     public function setConfirmed(?bool $confirmed): self
  715.     {
  716.         $this->confirmed $confirmed;
  717.         return $this;
  718.     }
  719.     public function getPlan(): Plan
  720.     {
  721.         return $this->plan;
  722.     }
  723.     /**
  724.      * Changes plan + plan group if it's different.
  725.      */
  726.     public function changePlan(Plan $plan): self
  727.     {
  728.         $this->plan $plan;
  729.         if ($plan->getPlanGroup() !== null)
  730.         {
  731.             $this->planGroup $plan->getPlanGroup()->getId();
  732.         }
  733.         return $this;
  734.     }
  735.     public function getPlanGroup(): ?int
  736.     {
  737.         return $this->planGroup;
  738.     }
  739.     public function getAddonGroup(): ?int
  740.     {
  741.         return $this->addonGroup;
  742.     }
  743.     public function setAddonGroup(?int $addonGroup): self
  744.     {
  745.         $this->addonGroup $addonGroup;
  746.         return $this;
  747.     }
  748.     public function getCustomPlans(): ?bool
  749.     {
  750.         return $this->customPlans;
  751.     }
  752.     public function setCustomPlans(?bool $customPlans): self
  753.     {
  754.         $this->customPlans $customPlans;
  755.         return $this;
  756.     }
  757.     public function isLitePlanAvailable(): ?bool
  758.     {
  759.         return $this->litePlanAvailable;
  760.     }
  761.     public function setLitePlanAvailable(?bool $litePlanAvailable): self
  762.     {
  763.         $this->litePlanAvailable $litePlanAvailable;
  764.         return $this;
  765.     }
  766.     public function getHomeDesign(): ?int
  767.     {
  768.         return $this->homeDesign;
  769.     }
  770.     public function setHomeDesign(?int $homeDesign): self
  771.     {
  772.         $this->homeDesign $homeDesign;
  773.         return $this;
  774.     }
  775.     public function getOnboarding(): ?int
  776.     {
  777.         return $this->onboarding;
  778.     }
  779.     public function setOnboarding(?int $onboarding): self
  780.     {
  781.         $this->onboarding $onboarding;
  782.         return $this;
  783.     }
  784.     public function hasEarlyUpgradeOffer(): ?bool
  785.     {
  786.         return $this->earlyUpgradeOffer;
  787.     }
  788.     public function setEarlyUpgradeOffer(?bool $earlyUpgradeOffer): self
  789.     {
  790.         $this->earlyUpgradeOffer $earlyUpgradeOffer;
  791.         return $this;
  792.     }
  793.     public function getTrialPlan(): ?string
  794.     {
  795.         return $this->trialPlan;
  796.     }
  797.     public function setTrialPlan(?string $trialPlan): self
  798.     {
  799.         $this->trialPlan $trialPlan;
  800.         return $this;
  801.     }
  802.     public function getPricingDesign(): ?int
  803.     {
  804.         return $this->pricingDesign;
  805.     }
  806.     public function setPricingDesign(?int $pricingDesign): self
  807.     {
  808.         $this->pricingDesign $pricingDesign;
  809.         return $this;
  810.     }
  811.     public function getPlanId(): int
  812.     {
  813.         return $this->plan->getId();
  814.     }
  815.     public function getBillingCycle(): ?string
  816.     {
  817.         return $this->billingCycle;
  818.     }
  819.     public function setBillingCycle(string $billingCycle): self
  820.     {
  821.         $this->billingCycle $billingCycle;
  822.         return $this;
  823.     }
  824.     public function getCurrency(): ?string
  825.     {
  826.         return $this->currency;
  827.     }
  828.     public function setCurrency(?string $currency): self
  829.     {
  830.         $this->currency $currency;
  831.         return $this;
  832.     }
  833.     public function getBalance(): ?string
  834.     {
  835.         return $this->balance;
  836.     }
  837.     public function setBalance(?string $balance): self
  838.     {
  839.         $this->balance $balance;
  840.         return $this;
  841.     }
  842.     public function getSubscriptionId(): ?string
  843.     {
  844.         return $this->subscriptionId;
  845.     }
  846.     public function setSubscriptionId(?string $subscriptionId): self
  847.     {
  848.         $this->subscriptionId $subscriptionId;
  849.         return $this;
  850.     }
  851.     public function getSubStatus(): ?string
  852.     {
  853.         return $this->subStatus;
  854.     }
  855.     public function setSubStatus(?string $subStatus): self
  856.     {
  857.         $this->subStatus $subStatus;
  858.         return $this;
  859.     }
  860.     public function getTrialExpiryLocalDate(): ?\DateTimeInterface
  861.     {
  862.         return Carbon::instance($this->trialExpiryLocalDate)->setHour(23)->setMinute(55);
  863.     }
  864.     public function setTrialExpiryLocalDate(?\DateTimeInterface $trialExpiryLocalDate): self
  865.     {
  866.         $this->trialExpiryLocalDate $trialExpiryLocalDate;
  867.         return $this;
  868.     }
  869.     public function getNextBillingDate(): ?\DateTimeInterface
  870.     {
  871.         return $this->nextBillingDate;
  872.     }
  873.     public function setNextBillingDate(?\DateTimeInterface $nextBillingDate): self
  874.     {
  875.         $this->nextBillingDate $nextBillingDate;
  876.         return $this;
  877.     }
  878.     public function getNextBillAmount(): ?string
  879.     {
  880.         return $this->nextBillAmount;
  881.     }
  882.     public function setNextBillAmount(?string $nextBillAmount): self
  883.     {
  884.         $this->nextBillAmount $nextBillAmount;
  885.         return $this;
  886.     }
  887.     public function getSpamStrikes(): int
  888.     {
  889.         return $this->spamStrikes;
  890.     }
  891.     public function setSpamStrikes(int $spamStrikes): self
  892.     {
  893.         $this->spamStrikes $spamStrikes;
  894.         return $this;
  895.     }
  896.     public function getSuspended(): ?int
  897.     {
  898.         return $this->suspended;
  899.     }
  900.     public function setSuspended(?int $suspended): self
  901.     {
  902.         $this->suspended $suspended;
  903.         return $this;
  904.     }
  905.     public function getAdminRating(): ?string
  906.     {
  907.         return $this->adminRating;
  908.     }
  909.     public function setAdminRating(?string $adminRating): self
  910.     {
  911.         $this->adminRating $adminRating;
  912.         return $this;
  913.     }
  914.     public function getPassword(): ?string
  915.     {
  916.         return $this->password;
  917.     }
  918.     public function setPassword(?string $password): self
  919.     {
  920.         $this->password $password;
  921.         return $this;
  922.     }
  923.     public function hasPasswordSet(): bool
  924.     {
  925.         return !empty($this->password);
  926.     }
  927.     public function getRef(): ?string
  928.     {
  929.         return $this->ref;
  930.     }
  931.     public function setRef(?string $ref): self
  932.     {
  933.         $this->ref $ref;
  934.         return $this;
  935.     }
  936.     public function getRefGift(): ?bool
  937.     {
  938.         return $this->refGift;
  939.     }
  940.     public function setRefGift(?bool $refGift): self
  941.     {
  942.         $this->refGift $refGift;
  943.         return $this;
  944.     }
  945.     public function getViews(): ?int
  946.     {
  947.         return $this->views;
  948.     }
  949.     public function setViews(?int $views): self
  950.     {
  951.         $this->views $views;
  952.         return $this;
  953.     }
  954.     public function getFirstVisit(): ?\DateTimeInterface
  955.     {
  956.         return $this->firstVisit;
  957.     }
  958.     public function setFirstVisit(?\DateTimeInterface $firstVisit): self
  959.     {
  960.         $this->firstVisit $firstVisit;
  961.         return $this;
  962.     }
  963.     public function getDateJoined(): ?\DateTimeInterface
  964.     {
  965.         return $this->dateJoined;
  966.     }
  967.     public function setDateJoined(\DateTimeInterface $dateJoined): self
  968.     {
  969.         $this->dateJoined $dateJoined;
  970.         return $this;
  971.     }
  972.     public function getDateActivated(): ?\DateTimeInterface
  973.     {
  974.         return $this->dateActivated;
  975.     }
  976.     public function setDateActivated(?\DateTimeInterface $dateActivated): self
  977.     {
  978.         $this->dateActivated $dateActivated;
  979.         return $this;
  980.     }
  981.     public function getLastLogin(): ?\DateTimeInterface
  982.     {
  983.         return $this->lastLogin;
  984.     }
  985.     public function setLastLogin(\DateTimeInterface $lastLogin): self
  986.     {
  987.         $this->lastLogin $lastLogin;
  988.         return $this;
  989.     }
  990.     public function getLastUpdated(): ?\DateTimeInterface
  991.     {
  992.         return $this->lastUpdated;
  993.     }
  994.     public function setLastUpdated(\DateTimeInterface $lastUpdated): self
  995.     {
  996.         $this->lastUpdated $lastUpdated;
  997.         return $this;
  998.     }
  999.     public function getDateFeatured(): ?\DateTimeInterface
  1000.     {
  1001.         return $this->dateFeatured;
  1002.     }
  1003.     public function setDateFeatured(?\DateTimeInterface $dateFeatured): self
  1004.     {
  1005.         $this->dateFeatured $dateFeatured;
  1006.         return $this;
  1007.     }
  1008.     public function getDateUpgraded(): ?\DateTimeInterface
  1009.     {
  1010.         return $this->dateUpgraded;
  1011.     }
  1012.     public function setDateUpgraded(?\DateTimeInterface $dateUpgraded): self
  1013.     {
  1014.         $this->dateUpgraded $dateUpgraded;
  1015.         return $this;
  1016.     }
  1017.     public function getNewsLastVisited(): ?\DateTimeInterface
  1018.     {
  1019.         return $this->newsLastVisited;
  1020.     }
  1021.     public function setNewsLastVisited(?\DateTimeInterface $newsLastVisited): self
  1022.     {
  1023.         $this->newsLastVisited $newsLastVisited;
  1024.         return $this;
  1025.     }
  1026.     public function getNotificationsLastVisited(): ?\DateTimeInterface
  1027.     {
  1028.         return $this->notificationsLastVisited;
  1029.     }
  1030.     public function setNotificationsLastVisited(?\DateTimeInterface $notificationsLastVisited): self
  1031.     {
  1032.         $this->notificationsLastVisited $notificationsLastVisited;
  1033.         return $this;
  1034.     }
  1035.     public function getTipsLastUpdated(): ?\DateTimeInterface
  1036.     {
  1037.         return $this->tipsLastUpdated;
  1038.     }
  1039.     public function setTipsLastUpdated(?\DateTimeInterface $tipsLastUpdated): self
  1040.     {
  1041.         $this->tipsLastUpdated $tipsLastUpdated;
  1042.         return $this;
  1043.     }
  1044.     public function getNewsFeedLastVisited(): ?\DateTimeInterface
  1045.     {
  1046.         return $this->newsFeedLastVisited;
  1047.     }
  1048.     public function setNewsFeedLastVisited(?\DateTimeInterface $newsFeedLastVisited): self
  1049.     {
  1050.         $this->newsFeedLastVisited $newsFeedLastVisited;
  1051.         return $this;
  1052.     }
  1053.     public function getProfilePhotoCoords(): ?string
  1054.     {
  1055.         return $this->profilePhotoCoords;
  1056.     }
  1057.     public function setProfilePhotoCoords(?string $profilePhotoCoords): self
  1058.     {
  1059.         $this->profilePhotoCoords $profilePhotoCoords;
  1060.         return $this;
  1061.     }
  1062.     public function getTimezone(): string
  1063.     {
  1064.         return $this->timezone;
  1065.     }
  1066.     public function setTimezone(string $timezone): self
  1067.     {
  1068.         $this->timezone $timezone;
  1069.         return $this;
  1070.     }
  1071.     public function getTwentyFour(): ?bool
  1072.     {
  1073.         return $this->twentyFour;
  1074.     }
  1075.     public function setTwentyFour(?bool $twentyFour): self
  1076.     {
  1077.         $this->twentyFour $twentyFour;
  1078.         return $this;
  1079.     }
  1080.     public function getProfilePhotoUpdated(): ?\DateTimeInterface
  1081.     {
  1082.         return $this->profilePhotoUpdated;
  1083.     }
  1084.     public function setProfilePhotoUpdated(?\DateTimeInterface $profilePhotoUpdated): self
  1085.     {
  1086.         $this->profilePhotoUpdated $profilePhotoUpdated;
  1087.         return $this;
  1088.     }
  1089.     public function getCoverPhotoCoords(): ?string
  1090.     {
  1091.         return $this->coverPhotoCoords;
  1092.     }
  1093.     public function setCoverPhotoCoords(?string $coverPhotoCoords): self
  1094.     {
  1095.         $this->coverPhotoCoords $coverPhotoCoords;
  1096.         return $this;
  1097.     }
  1098.     public function getCoverPhotoUpdated(): ?\DateTimeInterface
  1099.     {
  1100.         return $this->coverPhotoUpdated;
  1101.     }
  1102.     public function setCoverPhotoUpdated(?\DateTimeInterface $coverPhotoUpdated): self
  1103.     {
  1104.         $this->coverPhotoUpdated $coverPhotoUpdated;
  1105.         return $this;
  1106.     }
  1107.     public function getEmail()
  1108.     {
  1109.         return $this->email;
  1110.     }
  1111.     public function setEmail($email): self
  1112.     {
  1113.         $this->email $email;
  1114.         return $this;
  1115.     }
  1116.     public function getPublishingEmail()
  1117.     {
  1118.         return $this->publishingEmail;
  1119.     }
  1120.     public function setPublishingEmailmail($publishingEmail): self
  1121.     {
  1122.         $this->publishingEmail $publishingEmail;
  1123.         return $this;
  1124.     }
  1125.     public function getSortBy(): ?string
  1126.     {
  1127.         return $this->sortBy;
  1128.     }
  1129.     public function setSortBy(?string $sortBy): self
  1130.     {
  1131.         $this->sortBy $sortBy;
  1132.         return $this;
  1133.     }
  1134.     public function getLastSiteEmail(): ?int
  1135.     {
  1136.         return $this->lastSiteEmail;
  1137.     }
  1138.     public function setLastSiteEmail(?int $lastSiteEmail): self
  1139.     {
  1140.         $this->lastSiteEmail $lastSiteEmail;
  1141.         return $this;
  1142.     }
  1143.     public function isSpamCheckingEnabled(): bool
  1144.     {
  1145.         return $this->spamCheck;
  1146.     }
  1147.     public function setSpamCheckingEnabled(bool $spamCheck): self
  1148.     {
  1149.         $this->spamCheck $spamCheck;
  1150.         return $this;
  1151.     }
  1152.     public function getProfileVisibility(): ?string
  1153.     {
  1154.         return $this->profileVisibility;
  1155.     }
  1156.     public function setProfileVisibility(?string $profileVisibility): self
  1157.     {
  1158.         $this->profileVisibility $profileVisibility;
  1159.         return $this;
  1160.     }
  1161.     public function getAgeVisibility(): ?string
  1162.     {
  1163.         return $this->ageVisibility;
  1164.     }
  1165.     public function setAgeVisibility(?string $ageVisibility): self
  1166.     {
  1167.         $this->ageVisibility $ageVisibility;
  1168.         return $this;
  1169.     }
  1170.     public function getGenderVisibility(): ?string
  1171.     {
  1172.         return $this->genderVisibility;
  1173.     }
  1174.     public function setGenderVisibility(?string $genderVisibility): self
  1175.     {
  1176.         $this->genderVisibility $genderVisibility;
  1177.         return $this;
  1178.     }
  1179.     public function getNsfwVisibility(): ?string
  1180.     {
  1181.         return $this->nsfwVisibility;
  1182.     }
  1183.     public function setNsfwVisibility(?string $nsfwVisibility): self
  1184.     {
  1185.         $this->nsfwVisibility $nsfwVisibility;
  1186.         return $this;
  1187.     }
  1188.     public function getCountBrands(): ?int
  1189.     {
  1190.         return $this->countBrands;
  1191.     }
  1192.     public function setCountBrands(?int $countBrands): self
  1193.     {
  1194.         $this->countBrands $countBrands;
  1195.         return $this;
  1196.     }
  1197.     public function getEngagementUpdate(): ?\DateTimeInterface
  1198.     {
  1199.         return $this->engagementUpdate;
  1200.     }
  1201.     public function setEngagementUpdate(?\DateTimeInterface $engagementUpdate): self
  1202.     {
  1203.         $this->engagementUpdate $engagementUpdate;
  1204.         return $this;
  1205.     }
  1206.     public function setMauticId(?int $mauticId): self
  1207.     {
  1208.         $this->mauticId $mauticId;
  1209.         return $this;
  1210.     }
  1211.     public function getMauticId(): ?int
  1212.     {
  1213.         return $this->mauticId;
  1214.     }
  1215.     public function getAbArchive(): AbArchive
  1216.     {
  1217.         if (!$this->abArchive)
  1218.         {
  1219.             $abArchive = new AbArchive($this);
  1220.             $this->abArchive $abArchive;
  1221.         }
  1222.         return $this->abArchive;
  1223.     }
  1224.     public function setAbArchive(?AbArchive $abArchive): self
  1225.     {
  1226.         $this->abArchive $abArchive;
  1227.         return $this;
  1228.     }
  1229.     public function getAccountSettings(): AccountSettings
  1230.     {
  1231.         if (!$this->accountSettings)
  1232.         {
  1233.             $account_settings = new AccountSettings($thisfalsefalsefalse);
  1234.             $this->accountSettings $account_settings;
  1235.         }
  1236.         return $this->accountSettings;
  1237.     }
  1238.     public function setAccountSettings(?AccountSettings $accountSettings): self
  1239.     {
  1240.         $this->accountSettings $accountSettings;
  1241.         return $this;
  1242.     }
  1243.     public function getFlags(): MemberFlags
  1244.     {
  1245.         if (!$this->flags)
  1246.         {
  1247.             $flags = new MemberFlags($this);
  1248.             $this->flags $flags;
  1249.         }
  1250.         return $this->flags;
  1251.     }
  1252.     public function getProgress(): Progress
  1253.     {
  1254.         if (!$this->progress)
  1255.         {
  1256.             $progress = new Progress($this);
  1257.             $this->progress $progress;
  1258.         }
  1259.         return $this->progress;
  1260.     }
  1261.     public function getBitlyAccounts(): Collection
  1262.     {
  1263.         return $this->bitlyAccounts;
  1264.     }
  1265.     public function addBitlyAccount(Bitly $bitly): self
  1266.     {
  1267.         if (!$this->bitlyAccounts->contains($bitly))
  1268.         {
  1269.             $this->bitlyAccounts[] = $bitly;
  1270.         }
  1271.         return $this;
  1272.     }
  1273.     public function removeBitlyAccount(Bitly $bitly): self
  1274.     {
  1275.         if ($this->bitlyAccounts->contains($bitly))
  1276.         {
  1277.             $this->bitlyAccounts->removeElement($bitly);
  1278.         }
  1279.         return $this;
  1280.     }
  1281.     /**
  1282.      * @param bool $filterConnected - true = only connected apps; false = any apps
  1283.      *
  1284.      * @return Collection
  1285.      */
  1286.     public function getAndroidApps(bool $filterConnected false): Collection
  1287.     {
  1288.         return $this->androidApps->filter(function (AndroidApp $androidApp) use ($filterConnected)
  1289.         {
  1290.             $isConnected $androidApp->isConnected();
  1291.             if ($filterConnected === true)
  1292.             {
  1293.                 // only return apps that are connected correctly
  1294.                 return $isConnected;
  1295.             }
  1296.             // return all apps regardless of connection state
  1297.             return true;
  1298.         });
  1299.     }
  1300.     public function addAndroidApp(AndroidApp $androidApp): self
  1301.     {
  1302.         if (!$this->androidApps->contains($androidApp))
  1303.         {
  1304.             $this->androidApps->add($androidApp);
  1305.         }
  1306.         return $this;
  1307.     }
  1308.     public function removeAndroidApp(AndroidApp $androidApp): self
  1309.     {
  1310.         if ($this->androidApps->contains($androidApp))
  1311.         {
  1312.             $this->androidApps->removeElement($androidApp);
  1313.         }
  1314.         return $this;
  1315.     }
  1316.     /**
  1317.      * @param ?bool $filterConnected - true = only connected apps; false = only disconnected apps; null = all apps
  1318.      *
  1319.      * @return Collection
  1320.      */
  1321.     public function getIosApps(?bool $filterConnected): Collection
  1322.     {
  1323.         return $this->iosApps->filter(function (IosApp $iosApp) use ($filterConnected)
  1324.         {
  1325.             if ($filterConnected === true)
  1326.             {
  1327.                 // only return apps that are connected correctly
  1328.                 return $iosApp->isConnected();
  1329.             }
  1330.             elseif ($filterConnected === false)
  1331.             {
  1332.                 // only return apps that are NOT connected correctly
  1333.                 return !$iosApp->isConnected();
  1334.             }
  1335.             // return all apps regardless
  1336.             return true;
  1337.         });
  1338.     }
  1339.     public function addIosApp(IosApp $iosApp): self
  1340.     {
  1341.         if (!$this->iosApps->contains($iosApp))
  1342.         {
  1343.             $this->iosApps->add($iosApp);
  1344.         }
  1345.         return $this;
  1346.     }
  1347.     public function removeIosApp(IosApp $iosApp): self
  1348.     {
  1349.         if ($this->iosApps->contains($iosApp))
  1350.         {
  1351.             $this->iosApps->removeElement($iosApp);
  1352.         }
  1353.         return $this;
  1354.     }
  1355.     /**
  1356.      * Check if the member has an iOS app capable of publishing video/carousel posts to Instagram.
  1357.      *
  1358.      * @return bool
  1359.      */
  1360.     public function hasIosAppsThatSupportVideoCarousel(): bool
  1361.     {
  1362.         // currently only need to check for recent iOS apps builds.
  1363.         // if we add Video/Carousel support to Android, need to change PublishMethodResolver - look up MOBILE_IOS in resolveMobilePublish() there
  1364.         $iosAppsWithVideoCarouselSupport $this->getIosApps(true)->filter(function (IosApp $iosApp)
  1365.         {
  1366.             // we only want apps that support video & carousel
  1367.             return $iosApp->isVideoCarouselSupported();
  1368.         });
  1369.         return !$iosAppsWithVideoCarouselSupport->isEmpty();
  1370.     }
  1371.     /**
  1372.      * Check if the member has an Android app capable of publishing video/carousel posts to Instagram.
  1373.      *
  1374.      * @return bool
  1375.      */
  1376.     public function hasAndroidAppsThatSupportVideoCarousel(): bool
  1377.     {
  1378.         $androidAppsWithVideoCarouselSupport $this->getAndroidApps(true)->filter(function (AndroidApp $androidApp)
  1379.         {
  1380.             // we only want apps that support video & carousel
  1381.             return $androidApp->isVideoCarouselSupported();
  1382.         });
  1383.         return !$androidAppsWithVideoCarouselSupport->isEmpty();
  1384.     }
  1385.     /**
  1386.      * Check if the member has a mobile app connected.
  1387.      *
  1388.      * @return bool
  1389.      */
  1390.     public function isMobileAppConnected(): bool
  1391.     {
  1392.         return !$this->getIosApps(true)->isEmpty() || !$this->getAndroidApps(true)->isEmpty();
  1393.     }
  1394.     public function getBusiness(): ?Business
  1395.     {
  1396.         return $this->business;
  1397.     }
  1398.     public function setBusiness(Business $business): self
  1399.     {
  1400.         $this->business $business;
  1401.         return $this;
  1402.     }
  1403.     public function getUTM(): ?UTM
  1404.     {
  1405.         return $this->utm;
  1406.     }
  1407.     public function setUTM(?UTM $utm): self
  1408.     {
  1409.         $this->utm $utm;
  1410.         return $this;
  1411.     }
  1412.     public function getBookmarks(): Collection
  1413.     {
  1414.         return $this->bookmarks;
  1415.     }
  1416.     public function addBookmark(Bookmark $bookmark): self
  1417.     {
  1418.         if (!$this->bookmarks->contains($bookmark))
  1419.         {
  1420.             $this->bookmarks->add($bookmark);
  1421.         }
  1422.         return $this;
  1423.     }
  1424.     public function removeBookmark(Bookmark $bookmark): self
  1425.     {
  1426.         if ($this->bookmarks->contains($bookmark))
  1427.         {
  1428.             $this->bookmarks->removeElement($bookmark);
  1429.         }
  1430.         return $this;
  1431.     }
  1432.     public function getAddons(): Collection
  1433.     {
  1434.         return $this->addons;
  1435.     }
  1436.     public function addAddon(Addons $addon): self
  1437.     {
  1438.         if (!$this->addons->contains($addon))
  1439.         {
  1440.             $this->addons->add($addon);
  1441.         }
  1442.         return $this;
  1443.     }
  1444.     public function removeAddon(Addons $addon): self
  1445.     {
  1446.         if ($this->addons->contains($addon))
  1447.         {
  1448.             $this->addons->removeElement($addon);
  1449.         }
  1450.         return $this;
  1451.     }
  1452.     /**
  1453.      * Fetch all admin tags assigned to member.
  1454.      */
  1455.     public function getAdminTags(): Collection
  1456.     {
  1457.         return $this->adminTagAssignments->map(function (AdminTagAssignment $assignment): AdminTag
  1458.         {
  1459.             return $assignment->getAdminTag();
  1460.         });
  1461.     }
  1462.     /**
  1463.      * Add an admin tag to those assigned to member.
  1464.      *
  1465.      * @param AdminTag $tag
  1466.      * @param Member|null $assignedBy
  1467.      */
  1468.     public function addAdminTag(AdminTag $tag, ?Member $assignedBy): void
  1469.     {
  1470.         $this->adminTagAssignments->add(new AdminTagAssignment($tag$this$assignedBy, new \DateTime()));
  1471.     }
  1472.     /**
  1473.      * Remove an admin tag from those assigned to member.
  1474.      *
  1475.      * @param AdminTag $tag
  1476.      */
  1477.     public function removeAdminTag(AdminTag $tag): void
  1478.     {
  1479.         foreach ($this->adminTagAssignments as $assignment)
  1480.         {
  1481.             if ($assignment->getAdminTag()->getId() === $tag->getId())
  1482.             {
  1483.                 $this->adminTagAssignments->removeElement($assignment);
  1484.             }
  1485.         }
  1486.     }
  1487.     public function hasEmailBounced(): bool
  1488.     {
  1489.         return $this->emailBounced ?? false;
  1490.     }
  1491.     public function setEmailBounced(bool $bounced): self
  1492.     {
  1493.         $this->emailBounced $bounced;
  1494.         return $this;
  1495.     }
  1496.     /**
  1497.      * Get LeadDyno Affiliate object if this member has an affiliate account on LeadDyno.
  1498.      *
  1499.      * @return LeadDynoAffiliate
  1500.      */
  1501.     public function getLeadDynoAffiliate(): ?LeadDynoAffiliate
  1502.     {
  1503.         return $this->leadDynoAffiliate;
  1504.     }
  1505.     /**
  1506.      * Set a member as being a LeadDynoAffiliate.
  1507.      *
  1508.      * @param LeadDynoAffiliate|null $affiliate
  1509.      *
  1510.      * @return $this
  1511.      */
  1512.     public function setLeadDynoAffiliate(?LeadDynoAffiliate $affiliate): self
  1513.     {
  1514.         $this->leadDynoAffiliate $affiliate;
  1515.         // set (or unset) the owning side of the relation if necessary
  1516.         $newMember null === $affiliate null $this;
  1517.         if ($affiliate->getMember() !== $newMember)
  1518.         {
  1519.             $affiliate->setMember($newMember);
  1520.         }
  1521.         return $this;
  1522.     }
  1523.     /**
  1524.      * Get LeadDyno Lead object if this member was referred by a LeadDyno affiliate.
  1525.      *
  1526.      * @return LeadDynoLead
  1527.      */
  1528.     public function getLeadDynoLead(): ?LeadDynoLead
  1529.     {
  1530.         return $this->leadDynoLead;
  1531.     }
  1532.     /**
  1533.      * Get Referring Affiliate Code if this member is a LeadDyno Lead.
  1534.      *
  1535.      * @return string|null
  1536.      */
  1537.     public function getReferringAffiliateCode(): ?string
  1538.     {
  1539.         $leadDynoLead $this->leadDynoLead;
  1540.         if ($leadDynoLead)
  1541.         {
  1542.             return $leadDynoLead->getReferringAffiliateCode();
  1543.         }
  1544.         return null;
  1545.     }
  1546.     public function setMFASecret(?string $secret): self
  1547.     {
  1548.         $this->mfaSecret $secret;
  1549.         return $this;
  1550.     }
  1551.     public function getMFASecret(): ?string
  1552.     {
  1553.         return $this->mfaSecret;
  1554.     }
  1555.     public function hasMFAEnabled(): bool
  1556.     {
  1557.         return !empty($this->getMFASecret());
  1558.     }
  1559.     /**
  1560.      * Returns a string representation of the Member entity.
  1561.      *
  1562.      * @return string
  1563.      */
  1564.     public function __toString(): string
  1565.     {
  1566.         return sprintf('Member #%d'$this->id);
  1567.         // Customize the string representation as per your entity's properties
  1568.     }
  1569.     /**
  1570.      * @return Collection<Tour>
  1571.      */
  1572.     public function getTours(): Collection
  1573.     {
  1574.         return $this->tours;
  1575.     }
  1576.     public function addTour(Tour $tour): self
  1577.     {
  1578.         if (!$this->tours->contains($tour))
  1579.         {
  1580.             $this->tours[] = $tour;
  1581.         }
  1582.         return $this;
  1583.     }
  1584.     public function removeTour(Tour $tour): self
  1585.     {
  1586.         if ($this->tours->contains($tour))
  1587.         {
  1588.             $this->tours->removeElement($tour);
  1589.         }
  1590.         return $this;
  1591.     }
  1592.     public function skipOnboarding()
  1593.     {
  1594.         $this->setDateActivated(Carbon::now());
  1595.         $this->getProgress()
  1596.             ->setSocial(true)
  1597.             ->setCategories(true)
  1598.             ->setSchedule(true)
  1599.             ->setImport(true)
  1600.             ->setQueue(true)
  1601.             ->setFinished(true)
  1602.             ->setPostStatus(true);
  1603.         $newTourIds = [
  1604.             201 => 201,
  1605.             202 => 202,
  1606.             203 => 203,
  1607.             204 => 204,
  1608.         ];
  1609.         $tours $this->getTours();
  1610.         foreach ($tours as $tour)
  1611.         {
  1612.             if (in_array($tour->getId(), $newTourIds))
  1613.             {
  1614.                 unset($newTourIds[$tour->getId()]);
  1615.             }
  1616.         }
  1617.         foreach ($newTourIds as $newTourId)
  1618.         {
  1619.             $tour = new Tour($this$newTourId);
  1620.             $tour->setState('seen');
  1621.             $this->addTour($tour);
  1622.         }
  1623.     }
  1624. }