src/Entity/User.php line 315

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Filter\UserFilter;
  4. use App\Service\EsEncrypt;
  5. use App\Filter\UserNameFilter;
  6. use App\Filter\UserAdminFilter;
  7. use App\Annotation\EsUploadable;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use App\Annotation\EsElasticIndex;
  10. use App\Controller\UserController;
  11. use App\Repository\UserRepository;
  12. use ApiPlatform\Core\Annotation\ApiFilter;
  13. use App\Entity\Traits\TimestampableEntity;
  14. use Doctrine\ORM\Mapping\UniqueConstraint;
  15. use Doctrine\Common\Collections\Collection;
  16. use ApiPlatform\Core\Annotation\ApiProperty;
  17. use ApiPlatform\Core\Annotation\ApiResource;
  18. use App\Validator\Constraints as CustomAssert;
  19. use ApiPlatform\Core\Annotation\ApiSubresource;
  20. use App\Entity\Interfaces\ClientMappedInterface;
  21. use App\Entity\Interfaces\UploadMappedInterface;
  22. use Doctrine\Common\Collections\ArrayCollection;
  23. use App\Entity\Interfaces\ElasticMappedInterface;
  24. use Symfony\Component\Serializer\Annotation\Groups;
  25. use Symfony\Component\Serializer\Annotation\MaxDepth;
  26. use App\Entity\Interfaces\OperationLogMappedInterface;
  27. use Symfony\Component\Validator\Constraints as Assert;
  28. use Symfony\Component\Security\Core\User\UserInterface;
  29. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
  30. use Symfony\Component\Serializer\Annotation\SerializedName;
  31. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  32. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  33. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  34. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  35. use Hslavich\OneloginSamlBundle\Security\User\SamlUserInterface;
  36. use Locastic\ApiPlatformTranslationBundle\Model\AbstractTranslatable;
  37. use Locastic\ApiPlatformTranslationBundle\Model\TranslationInterface;
  38. use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
  39. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  40. /**
  41.  * @ApiResource(
  42.  *      attributes={"filters"={"translation.groups"}},
  43.  *      normalizationContext={"groups"={"User:Read"}, "skip_null_values"=false, "enable_max_depth"=true},
  44.  *      denormalizationContext={"groups"={"User:Write", "UserTranslationGroup"}},
  45.  *      collectionOperations={
  46.  *          "post"={"security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"},
  47.  *          "get"={"security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"},
  48.  *          "get_admin_list"={
  49.  *              "path"="/users/get-admin-list",
  50.  *              "method"="GET",
  51.  *              "normalization_context"={"groups"={"User:Get-Admin-List"}, "skip_null_values"=false},
  52.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  53.  *          },
  54.  *          "get_admin"={
  55.  *              "path"="/users/get-admin",
  56.  *              "method"="GET",
  57.  *              "normalization_context"={"groups"={"User:Get-Admin","User:Get-Admin-List"}, "skip_null_values"=false},
  58.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  59.  *          },
  60.  *          "get_limited"={
  61.  *              "path"="/users/get-limited",
  62.  *              "method"="GET",
  63.  *              "normalization_context"={"groups"={"User:Get-Limited"}, "skip_null_values"=false},
  64.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  65.  *          },
  66.  *          "get_me"={
  67.  *              "route_name"="api_users_me_collection",
  68.  *              "method"="GET",
  69.  *              "normalization_context"={"groups"={"User:Me"}, "skip_null_values"=false},
  70.  *              "security"="is_granted('PUBLIC_ACCESS')"
  71.  *          },
  72.  *          "get_me_subscribed"={
  73.  *              "route_name"="api_users_me_subscribed_collection",
  74.  *              "method"="GET",
  75.  *              "normalization_context"={"groups"={"User:Me", "User:Me-Subscribed"}, "skip_null_values"=false, "enable_max_depth"=true},
  76.  *              "security"="is_granted('PUBLIC_ACCESS')"
  77.  *          },
  78.  *          "get_attendee_list"={
  79.  *              "path"="/users/attendee-list",
  80.  *              "method"="GET",
  81.  *              "normalization_context"={"groups"={"User:Attendee-List"}, "skip_null_values"=false},
  82.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')",
  83.  *              "pagination_client_partial"=true
  84.  *          },
  85.  *          "get_attendee_list_o"={
  86.  *              "path"="/users/attendee-list-o",
  87.  *              "method"="GET",
  88.  *              "normalization_context"={"groups"={"User:Attendee-List-O"}, "skip_null_values"=false},
  89.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')",
  90.  *              "pagination_client_partial"=true
  91.  *          },
  92.  *          "get_for_assign"={
  93.  *              "path"="/users/get-for-assign",
  94.  *              "method"="GET",
  95.  *              "normalization_context"={"groups"={"User:Attendee-List"}, "skip_null_values"=false},
  96.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  97.  *          },
  98.  *          "get_for_assign_with_group"={
  99.  *              "path"="/users/get-for-assign-with-group",
  100.  *              "method"="GET",
  101.  *              "normalization_context"={"groups"={"User:Assign-List"}, "skip_null_values"=false},
  102.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  103.  *          },
  104.  *          "post_email_exist"={
  105.  *              "route_name"="api_users_email_exist_collection",
  106.  *              "method"="POST",
  107.  *              "denormalization_context"={"groups"={"User:Email-Exist"}, "skip_null_values"=false}
  108.  *          },
  109.  *          "post_invite_code"={
  110.  *              "route_name"="api_users_invite_code_collection",
  111.  *              "method"="POST",
  112.  *              "denormalization_context"={"groups"={"User:Invite-Code"}, "skip_null_values"=false}
  113.  *          },
  114.  *          "post_ug_attach"={
  115.  *              "route_name"="api_users_ug_attach_collection",
  116.  *              "method"="POST",
  117.  *              "denormalization_context"={"groups"={"User:Ug-Attach"}, "skip_null_values"=false}
  118.  *          },
  119.  *          "post_user_exist"={
  120.  *              "route_name"="api_users_user_exist_collection",
  121.  *              "method"="POST",
  122.  *              "denormalization_context"={"groups"={"User:Email-Exist"}, "skip_null_values"=false},
  123.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  124.  *          },
  125.  *          "post_user_attach"={
  126.  *              "route_name"="api_users_user_attach_collection",
  127.  *              "method"="POST",
  128.  *              "denormalization_context"={"groups"={"User:Email-Exist"}, "skip_null_values"=false},
  129.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  130.  *          },
  131.  *          "post_feed_subscribe"={
  132.  *              "route_name"="api_users_feed_subscribe_collection",
  133.  *              "method"="POST",
  134.  *              "denormalization_context"={"groups"={"User:Feed-Subscribe"}, "skip_null_values"=false},
  135.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')",
  136.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  137.  *          },
  138.  *          "post_feed_subscribe_category"={
  139.  *              "route_name"="api_users_feed_subscribe_category_collection",
  140.  *              "method"="POST",
  141.  *              "denormalization_context"={"groups"={"User:Feed-Subscribe"}, "skip_null_values"=false},
  142.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')",
  143.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  144.  *          },
  145.  *          "post_container_feed_subscribe"={
  146.  *              "route_name"="api_users_container_feed_subscribe_collection",
  147.  *              "method"="POST",
  148.  *              "denormalization_context"={"groups"={"User:Container-Feed-Subscribe"}, "skip_null_values"=false},
  149.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')",
  150.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  151.  *          },
  152.  *          "post_container_feed_send"={
  153.  *              "route_name"="api_users_container_feed_send_collection",
  154.  *              "method"="POST",
  155.  *              "denormalization_context"={"groups"={"User:Container-Feed-Send"}, "skip_null_values"=false},
  156.  *              "security"="is_granted('ROLE_ADMIN')",
  157.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  158.  *          },
  159.  *          "post_global_create"={
  160.  *              "route_name"="api_users_global_create_collection",
  161.  *              "method"="POST",
  162.  *              "denormalization_context"={"groups"={"User:Global-Create"}, "skip_null_values"=false},
  163.  *              "security"="is_granted('ROLE_SUPER_ADMIN')",
  164.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  165.  *          },
  166.  *          "post_global_delete"={
  167.  *              "route_name"="api_users_global_delete_collection",
  168.  *              "method"="POST",
  169.  *              "denormalization_context"={"groups"={"User:Global-Delete"}, "skip_null_values"=false},
  170.  *              "security"="is_granted('ROLE_SUPER_ADMIN')",
  171.  *              "output_formats"={"json"={"application/ld+json", "application/json"}}
  172.  *          },
  173.  *          "get_for_public_page"={
  174.  *              "route_name"="api_pub_users_get_for_public_page_collection",
  175.  *              "method"="GET",
  176.  *              "security"="is_granted('PUBLIC_ACCESS')",
  177.  *              "normalization_context"={"groups"={"User:PRead"}, "skip_null_values"=false},
  178.  *              "pagination_enabled"=true
  179.  *          },
  180.  *          "get_for_select_public_page"={
  181.  *              "route_name"="api_pub_users_get_for_select_public_page_collection",
  182.  *              "method"="GET",
  183.  *              "security"="is_granted('PUBLIC_ACCESS')",
  184.  *              "normalization_context"={"groups"={"User:PSRead"}, "skip_null_values"=false},
  185.  *              "pagination_enabled"=true
  186.  *          },
  187.  *      },
  188.  *      itemOperations={
  189.  *          "get"={
  190.  *              "normalization_context"={"groups"={"User:Read", "User:Get-Item"}, "skip_null_values"=false},
  191.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT') || object == user"
  192.  *          },
  193.  *          "get_open"={
  194.  *              "normalization_context"={"groups"={"User:Get-Open"}, "skip_null_values"=false},
  195.  *              "path"="/users/{id}/open",
  196.  *              "method"="GET",
  197.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  198.  *          },
  199.  *          "get_open_wr"={
  200.  *              "normalization_context"={"groups"={"User:Read", "User:Get-RoleContainer"}, "skip_null_values"=false},
  201.  *              "path"="/users/{id}/open-wr",
  202.  *              "method"="GET",
  203.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  204.  *          },
  205.  *          "get_attendee_view"={
  206.  *              "normalization_context"={"groups"={"User:Read", "User:Get-Item"}, "skip_null_values"=false},
  207.  *              "path"="/users/{id}/attendee-view",
  208.  *              "method"="GET",
  209.  *              "security"="is_granted('IS_AUTHENTICATED_FULLY')"
  210.  *          },
  211.  *          "get_for_public_item_page"={
  212.  *              "route_name"="api_pub_users_get_for_public_page_item",
  213.  *              "method"="GET",
  214.  *              "security"="is_granted('PUBLIC_ACCESS')",
  215.  *              "normalization_context"={"groups"={"User:PRead"}, "skip_null_values"=false}
  216.  *          },
  217.  *          "put"={"security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"},
  218.  *          "put_change_profile"={
  219.  *              "route_name"="api_users_change_profile_item",
  220.  *              "method"="PUT",
  221.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  222.  *              "denormalization_context"={"groups"={"User:Change-Profile"}},
  223.  *              "validation_groups"={"User:Strong-Password"}
  224.  *          },
  225.  *          "patch"={"security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"},
  226.  *          "patch_change_email"={
  227.  *              "route_name"="api_users_change_email_item",
  228.  *              "method"="PATCH",
  229.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  230.  *              "denormalization_context"={"groups"={"User:Change-Email"}}
  231.  *          },
  232.  *          "patch_change_password"={
  233.  *              "route_name"="api_users_change_password_item",
  234.  *              "method"="PATCH",
  235.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  236.  *              "denormalization_context"={"groups"={"User:Change-Password"}},
  237.  *              "validation_groups"={"User:Change-Password", "User:Strong-Password"}
  238.  *          },
  239.  *          "patch_follow_unfollow"={
  240.  *              "route_name"="api_users_follow_unfollow_item",
  241.  *              "method"="PATCH",
  242.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  243.  *              "denormalization_context"={"groups"={"User:Follow-Unfollow"}},
  244.  *              "output"=false
  245.  *          },
  246.  *          "patch_follow_unfollow_company"={
  247.  *              "route_name"="api_users_follow_unfollow_company_item",
  248.  *              "method"="PATCH",
  249.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  250.  *              "denormalization_context"={"groups"={"User:Follow-Unfollow-Company"}},
  251.  *              "output"=false
  252.  *          },
  253.  *          "patch_notification_company"={
  254.  *              "route_name"="api_users_follow_notification_company_item",
  255.  *              "method"="PATCH",
  256.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  257.  *              "denormalization_context"={"groups"={"User:Notification-Company"}},
  258.  *              "output"=false
  259.  *          },
  260.  *          "patch_reset_password"={
  261.  *              "route_name"="api_users_reset_password_item",
  262.  *              "method"="PATCH",
  263.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && (is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT'))",
  264.  *              "denormalization_context"={"groups"={"User:Reset-Password"}}
  265.  *          },
  266.  *          "patch_change_login_onboarding"={
  267.  *              "route_name"="api_users_change_login_onboarding_item",
  268.  *              "method"="PATCH",
  269.  *              "security"="is_granted('IS_CLIENT_OWNER', object) && object == user",
  270.  *              "denormalization_context"={"groups"={"User:Change-Login-Onboarding"}},
  271.  *              "validation_groups"={"User:Strong-Password"}
  272.  *          },
  273.  *          "patch_unsubscribe"={
  274.  *              "route_name"="api_users_unsubscribe_item",
  275.  *              "method"="PATCH",
  276.  *              "security"="is_granted('ROLE_OPERATOR') || is_granted('ROLE_SUPPORT')"
  277.  *          },
  278.  *          "patch_change_role"={
  279.  *              "route_name"="api_users_change_role_item",
  280.  *              "method"="PATCH",
  281.  *              "security"="is_granted('ROLE_OPERATOR', object) || is_granted('ROLE_SUPPORT', object)",
  282.  *              "denormalization_context"={"groups"={"User:Change-Role"}}
  283.  *          },
  284.  *          "delete_delete"={
  285.  *              "route_name"="api_users_delete_item",
  286.  *              "method"="DELETE",
  287.  *              "security"="is_granted('ROLE_OPERATOR', object) || is_granted('ROLE_SUPPORT', object) || object == user"
  288.  *          }
  289.  *      }
  290.  * )
  291.  * @ApiFilter(SearchFilter::class, properties={"id": "exact", "client.id": "exact", "userContainer.id": "exact", "status": "exact", "email": "partial", "firstName": "partial", "lastName": "partial","company": "partial","jobTitle": "partial","roleContainers.role": "exact","roleContainers.container.id": "exact","relationManager.id": "exact","userGroups.id": "exact","userTags.id": "exact","source": "exact", "followers.id": "exact", "following.id": "exact", "glnNumber": "exact", "registeredToConferences.id", "exact", "country": "exact", "userAcademicTitles.academicTitle.id": "exact", "specialTitles.id": "exact", "categories.id": "exact", "userCreditPoints.creditCategory.id": "exact", "organization.id": "exact"})
  292.  * @ApiFilter(BooleanFilter::class, properties={"isExposeEmail", "isAllowCommunication", "isDisplayAsGuest", "isOnboarded", "isBlocked", "isUnsubscribedInvite", "isEmailOff"})
  293.  * @ApiFilter(DateFilter::class, properties={"onboardedAt", "createdAt", "lastLoginAt"})
  294.  * @ApiFilter(UserFilter::class, properties={"search": "partial"})
  295.  * @ApiFilter(UserNameFilter::class, properties={"search": "partial"})
  296.  * @ApiFilter(UserAdminFilter::class, properties={"search": "partial"})
  297.  * @ApiFilter(OrderFilter::class, properties={"id", "firstName": "ASC", "lastName", "email", "status", "company", "jobTitle"})
  298.  * @ORM\Entity(repositoryClass=UserRepository::class)
  299.  * @UniqueEntity(fields={"email", "client"}, message="validation.user:email.alreadyExist")
  300.  * @ORM\Table(
  301.  *      name="user",
  302.  *      indexes={
  303.  *          @ORM\Index(name="user_email_idx", columns={"email"}),
  304.  *          @ORM\Index(name="is_onboarded_idx", columns={"is_onboarded"}),
  305.  *          @ORM\Index(name="is_display_as_guest_idx", columns={"is_display_as_guest"}),
  306.  *          @ORM\Index(name="last_name_idx", columns={"last_name"})
  307.  *      },
  308.  *      uniqueConstraints={@UniqueConstraint(name="user_unique", columns={"email", "client_id"})}
  309.  * )
  310.  * @EsElasticIndex("User:EL")
  311.  */
  312. class User extends AbstractTranslatable implements UserInterfacePasswordAuthenticatedUserInterfaceSamlUserInterfaceClientMappedInterfaceUploadMappedInterfaceOperationLogMappedInterfaceElasticMappedInterface
  313. {
  314.     /**
  315.      * Hook timestampable behavior
  316.      * updates createdAt, updatedAt fields
  317.      */
  318.     use TimestampableEntity;
  319.     /**
  320.      * @ORM\OneToMany(targetEntity="UserTranslation", mappedBy="translatable", fetch="EXTRA_LAZY", indexBy="locale", cascade={"PERSIST"}, orphanRemoval=true)
  321.      *
  322.      * @Groups({"User:Write", "User:Change-Profile", "UserTranslationGroup"})
  323.      * @Assert\Valid()
  324.      */
  325.     protected $translations;
  326.     /**
  327.      * @Groups({"User:Get-Item"})
  328.      */
  329.     private $biography;
  330.     /**
  331.      * @ORM\Id
  332.      * @ORM\GeneratedValue
  333.      * @ORM\Column(type="integer")
  334.      * @Groups({"User:EL", "Conference:EL", "Session:EL", "VideoGallery:EL", "ElCourse:EL", "ElTask:EL", "Newsfeed:EL", "DocFile:EL", "User:Exp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "User:PSRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List", "ElCourseRating:Read", "User:Get-Open"})
  335.      */
  336.     private $id;
  337.     /**
  338.      * @ORM\Column(type="estring", length=255)
  339.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Change-Email", "User:Attendee-List", "User:Get-Limited","Session:Select", "VideoGalleryHistory:Read", "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "User:Email-Exist", "VoteResult:Read", "VoteResult:Exp", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "VoucherCode:Exp", "ElExamAttempt:Read", "ElExamAnswer:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SurveyResult:Read", "User:Invite-Code", "User:Ug-Attach", "User:Global-Create", "User:Global-Delete"})
  340.      * @Assert\NotBlank(message="validation.user:email.notBlank")
  341.      * @Assert\Email(message="validation.user:email.email", mode="loose")
  342.      * @Assert\Length(max=255, maxMessage="validation.user:email.max")
  343.      * @CustomAssert\IsUserEmailDomainValid()
  344.      */
  345.     private $email;
  346.     /**
  347.      * @var string The hashed password
  348.      * @ORM\Column(type="string", nullable=true)
  349.      */
  350.     private $password;
  351.     /**
  352.      * @Groups({"User:Exp", "User:Imp", "User:Write", "User:Change-Profile", "User:Change-Password", "User:Reset-Password", "User:Change-Login-Onboarding", "User:Global-Create"})
  353.      * @CustomAssert\StrongPasswordStrength(groups={"User:Strong-Password"})
  354.      */
  355.     private $plainPassword;
  356.     /**
  357.      * @UserPassword(message="validation.user:oldPassword.incorrect", groups={"User:Change-Password"})
  358.      * @Groups({"User:Change-Password"})
  359.      */
  360.     private $oldPassword;
  361.     /**
  362.      * @ORM\Column(type="estring", length=255, nullable=true)
  363.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "User:PSRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List", "ElCourseRating:Read", "User:Global-Create", "User:Get-Open"})
  364.      * @Assert\Length(max=255, maxMessage="validation.user:firstName.max")
  365.      */
  366.     private $firstName;
  367.     /**
  368.      * @ORM\Column(type="estring", length=255, nullable=true)
  369.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "User:PSRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List", "ElCourseRating:Read", "User:Global-Create", "User:Get-Open"})
  370.      * @Assert\Length(max=255, maxMessage="validation.user:lastName.max")
  371.      */
  372.     private $lastName;
  373.     /**
  374.      * @ORM\Column(type="string", length=16, nullable=true)
  375.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me", "User:Attendee-List", "User:Change-Profile", "User:Change-Login-Onboarding"})
  376.      * @Assert\Length(max=16, maxMessage="validation.user:locale.max")
  377.      */
  378.     private $locale;
  379.     /**
  380.      * @ORM\ManyToOne(targetEntity=Client::class)
  381.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  382.      * @Groups({"User:Read","User:Me","User:PRead"})
  383.      */
  384.     private $client;
  385.     /**
  386.      * @ORM\Column(type="string", length=32)
  387.      * @ApiProperty(
  388.      *     attributes={
  389.      *         "openapi_context"={
  390.      *             "type"="string",
  391.      *             "enum"={self::STATUS_ACTIVE, self::STATUS_INACTIVE}
  392.      *         }
  393.      *     }
  394.      * )
  395.      * @Groups({"User:Exp", "User:Read","User:Write","User:Me"})
  396.      * @Assert\Choice({self::STATUS_ACTIVE, self::STATUS_INACTIVE})
  397.      */
  398.     private $status;
  399.     public const STATUS_ACTIVE 'ACTIVE';
  400.     public const STATUS_INACTIVE 'INACTIVE';
  401.     /**
  402.      * @ORM\Column(type="estring", length=255, nullable=true)
  403.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "Session:VideoLibrary", "Meeting:Read", "MeetingBooking:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "User:PRead", "User:Assign-List"})
  404.      * @Assert\Length(max=255, maxMessage="validation.user:company.max")
  405.      */
  406.     private $company;
  407.     /**
  408.      * @ORM\Column(type="estring", length=255, nullable=true)
  409.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "Session:VideoLibrary", "Meeting:Read", "MeetingBooking:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "User:PRead", "User:Assign-List"})
  410.      * @Assert\Length(max=255, maxMessage="validation.user:jobTitle.max")
  411.      */
  412.     private $jobTitle;
  413.     /**
  414.      * @ORM\ManyToMany(targetEntity=Role::class)
  415.      */
  416.     private $roles;
  417.     /**
  418.      * @ORM\OneToMany(targetEntity=RoleContainer::class, mappedBy="user", cascade={"persist"}, orphanRemoval=true)
  419.      * @Groups({"User:Get-RoleContainer"})
  420.      */
  421.     private $roleContainers;
  422.     /**
  423.      * @ORM\ManyToMany(targetEntity=UserGroup::class, inversedBy="users")
  424.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me", "User:Ug-Attach"})
  425.      */
  426.     private $userGroups;
  427.     /**
  428.      * @ORM\ManyToMany(targetEntity=UserTag::class, mappedBy="users", cascade={"persist"})
  429.      * @Groups({"User:Exp", "User:Read","User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile"})
  430.      */
  431.     private $userTags;
  432.     /**
  433.      * @ORM\Column(type="string", length=255, nullable=true)
  434.      * @Groups({"User:Exp", "User:Imp","User:EL", "Conference:EL", "Session:EL", "VideoGallery:EL", "ElCourse:EL", "ElTask:EL", "Newsfeed:EL", "DocFile:EL", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write", "User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "User:PSRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List", "ElCourseRating:Read", "User:Get-Open"})
  435.      * @Assert\Length(max=255, maxMessage="validation.user:imageName.max")
  436.      * @EsUploadable()
  437.      */
  438.     protected $imageName;
  439.     /**
  440.      * @Groups({"User:Exp", "User:Imp"})
  441.      */
  442.     protected $imageUrl;
  443.     /**
  444.      * @ORM\Column(type="string", length=16)
  445.      * @ApiProperty(
  446.      *     attributes={
  447.      *         "openapi_context"={
  448.      *             "type"="string",
  449.      *             "enum"={self::SOURCE_CREATE, self::SOURCE_INVITE, self::SOURCE_IMPORT, self::SOURCE_REGISTER, self::SOURCE_SOCIAL, self::SOURCE_ANONYMOUS_READER, self::SOURCE_INVITE_EXTERNAL}
  450.      *         }
  451.      *     }
  452.      * )
  453.      * @Groups({"User:Exp", "User:Read", "User:Write", "User:Me","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read"})
  454.      *
  455.      * @Assert\Choice({self::SOURCE_CREATE, self::SOURCE_INVITE, self::SOURCE_IMPORT, self::SOURCE_REGISTER, self::SOURCE_GUEST_VOTER, self::SOURCE_SOCIAL, self::SOURCE_ANONYMOUS_READER, self::SOURCE_INVITE_EXTERNAL})
  456.      */
  457.     private $source;
  458.     public const SOURCE_CREATE 'CREATE';
  459.     public const SOURCE_INVITE 'INVITE';
  460.     public const SOURCE_IMPORT 'IMPORT';
  461.     public const SOURCE_REGISTER 'REGISTER';
  462.     public const SOURCE_GUEST_VOTER 'GUEST_VOTER';
  463.     public const SOURCE_SOCIAL 'SOCIAL';
  464.     public const SOURCE_ANONYMOUS_READER 'ANONYMOUS_READER';
  465.     public const SOURCE_INVITE_EXTERNAL 'INVITE_EXTERNAL';
  466.     /**
  467.      * @ORM\Column(type="boolean", nullable=true)
  468.      * @Groups({"User:Exp", "User:Read","User:Write","User:Me", "User:Change-Login-Onboarding", "User:Change-Profile"})
  469.      */
  470.     private $isOnboarded false;
  471.     /**
  472.      * @ORM\Column(type="boolean", nullable=true)
  473.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me"})
  474.      */
  475.     private $isBlocked false;
  476.     /**
  477.      * @ORM\Column(type="datetime", nullable=true)
  478.      * @Groups({"User:Exp", "User:Read","User:Write","User:Me", "EventLog:Read","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read"})
  479.      */
  480.     private $onboardedAt;
  481.     /**
  482.      * @ORM\Column(type="datetime", nullable=true)
  483.      * @Groups({"User:Exp", "User:Read","User:Write","User:Me", "EventLog:Read","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read"})
  484.      */
  485.     private $lastLoginAt;
  486.     /**
  487.      * @ORM\Column(type="boolean", nullable=true)
  488.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding", "User:Get-Open"})
  489.      */
  490.     private $isDisplayAsGuest true;
  491.     /**
  492.      * @ORM\Column(type="boolean", nullable=true)
  493.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding"})
  494.      */
  495.     private $isExposeEmail false;
  496.     /**
  497.      * @ORM\Column(type="boolean", nullable=true)
  498.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List", "User:Attendee-List-O","User:Change-Profile", "User:Change-Login-Onboarding", "User:Get-Open"})
  499.      */
  500.     private $isAllowCommunication true;
  501.     /**
  502.      * @ORM\Column(type="string", length=64, nullable=true)
  503.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Change-Profile"})
  504.      */
  505.     private $timezone;
  506.     /**
  507.      * @ORM\ManyToOne(targetEntity=User::class)
  508.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  509.      * @Groups({"User:Read","User:Write","User:Me","User:Change-Profile", "User:Attendee-List"})
  510.      * @ApiSubresource(maxDepth=1)
  511.      */
  512.     private $relationManager;
  513.     /**
  514.      * @Groups({"User:Exp", "User:Imp"})
  515.      */
  516.     private $rmEmail;
  517.     /**
  518.      * @Groups({"User:Read","User:Write", "User:Attendee-List", "User:Attendee-List-O",  "User:Get-Limited","Session:Select"})
  519.      */
  520.     private string $search;
  521.     private $tmpRoles;
  522.     /**
  523.      * @ORM\Column(type="boolean", nullable=true)
  524.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Change-Profile", "User:Change-Login-Onboarding"})
  525.      */
  526.     private $isPwdGenerated false;
  527.     /**
  528.      * @ORM\ManyToMany(targetEntity=ChatThread::class, mappedBy="users")
  529.      */
  530.     private $chatThreads;
  531.     /**
  532.      * @ORM\Column(type="boolean", nullable=true)
  533.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "DocFile:Read", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "SurveyResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read"})
  534.      */
  535.     private $isOnline;
  536.     /**
  537.      * @ORM\Column(type="boolean", nullable=true)
  538.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Change-Profile", "User:Change-Login-Onboarding"})
  539.      */
  540.     private $isShowDisclaimer true;
  541.     protected $samlAttributes;
  542.     /**
  543.      * @ORM\Column(type="string", length=255, nullable=true)
  544.      * @Groups({"User:Exp", "User:Imp", "Import:Read", "User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  545.      */
  546.     private $saLinkedin;
  547.     /**
  548.      * @ORM\Column(type="string", length=255, nullable=true)
  549.      * @Groups({"User:Exp", "User:Imp", "Import:Read", "User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  550.      */
  551.     private $saTwitter;
  552.     /**
  553.      * @ORM\Column(type="string", length=255, nullable=true)
  554.      * @Groups({"User:Exp", "User:Imp", "Import:Read", "User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  555.      */
  556.     private $saFacebook;
  557.     /**
  558.      * @ORM\Column(type="string", length=255, nullable=true)
  559.      * @Groups({"User:Exp", "User:Imp", "Import:Read", "User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  560.      */
  561.     private $saInstagram;
  562.     /**
  563.      * @ORM\Column(type="string", length=255, nullable=true)
  564.      * @Groups({"User:Exp", "User:Imp", "Import:Read", "User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  565.      */
  566.     private $saYoutube;
  567.     /**
  568.      * @ORM\OneToMany(targetEntity=ElTaskAttempt::class, mappedBy="user", orphanRemoval=true)
  569.      * @Groups({"User:Me"})
  570.      */
  571.     private $elTaskAttempts;
  572.     /**
  573.      * @ORM\ManyToMany(targetEntity=ElCourse::class, mappedBy="users")
  574.      */
  575.     private $elCourses;
  576.     /**
  577.      * @ORM\OneToMany(targetEntity=ElCourseJoin::class, mappedBy="user", orphanRemoval=true)
  578.      * @Groups({"User:Me"})
  579.      */
  580.     private $elCourseJoins;
  581.     /**
  582.      * @ORM\OneToMany(targetEntity=ElExamAttempt::class, mappedBy="user", orphanRemoval=true)
  583.      * @Groups({"User:Me"})
  584.      */
  585.     private $elExamAttempts;
  586.     /**
  587.      * @ORM\Column(type="string", length=32, nullable=true)
  588.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "SurveyResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "User:PRead", "User:Assign-List"})
  589.      */
  590.     private $country;
  591.     /**
  592.      * @ORM\Column(type="integer", nullable=true)
  593.      */
  594.     private $failAttemptCount;
  595.     /**
  596.      * @ORM\Column(type="datetime", nullable=true)
  597.      */
  598.     private $lastFailAttemptAt;
  599.     /**
  600.      * @ORM\Column(type="datetime", nullable=true)
  601.      */
  602.     private $loginBlockUntilAt;
  603.     /**
  604.      * @ORM\Column(type="boolean", nullable=true)
  605.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  606.      */
  607.     private $isConsiderSpeaker;
  608.     /**
  609.      * @ORM\Column(type="boolean", nullable=true)
  610.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select", "User:Get-Item", "User:PRead"})
  611.      */
  612.     private $isConsiderModerator;
  613.     /**
  614.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="followers")
  615.      * @Groups({"User:Get-Item", "User:Attendee-List", "User:Get-Following", "User:Get-Open"})
  616.      * @ApiProperty(readableLink=false)
  617.      */
  618.     private $following;
  619.     /**
  620.      * @ORM\ManyToMany(targetEntity=User::class, mappedBy="following")
  621.      * @Groups({"User:Get-Item", "User:Attendee-List", "User:Get-Followers", "User:Get-Open"})
  622.      * @ApiProperty(readableLink=false)
  623.      */
  624.     private $followers;
  625.     /**
  626.      * @var integer
  627.      * @Groups({"User:Follow-Unfollow"})
  628.      */
  629.     private $folowUnfollowUserId;
  630.     /**
  631.      * @var bool
  632.      * @Groups({"User:Follow-Unfollow"})
  633.      */
  634.     private $isUnfollow false;
  635.     /**
  636.      * @ORM\OneToMany(targetEntity=NewsfeedLike::class, mappedBy="user")
  637.      * @Groups({"User:Me-Subscribed"})
  638.      * @MaxDepth(1)
  639.      */
  640.     private $newsfeedLikes;
  641.     /**
  642.      * @ORM\OneToMany(targetEntity=CommonCommentLike::class, mappedBy="user")
  643.      * @Groups({"User:Me-Subscribed"})
  644.      * @MaxDepth(1)
  645.      */
  646.     private $commonCommentLikes;
  647.     /**
  648.      * @ORM\OneToMany(targetEntity=SessionQuestionLike::class, mappedBy="user")
  649.      * @Groups({"User:Me-Subscribed"})
  650.      * @MaxDepth(1)
  651.      */
  652.     private $sessionQuestionLikes;
  653.     /**
  654.      * @ORM\Column(type="boolean", nullable=true)
  655.      * @Groups({"User:Exp", "User:Imp", "User:Read", "User:Write", "Conference:PRead", "Session:PRead", "User:PRead", "ElCourse:PRead", "Company:PRead", "VideoGallery:PRead"})
  656.      */
  657.     private $isShowPublic;
  658.     /**
  659.      * @ORM\Column(type="boolean", nullable=true)
  660.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding"})
  661.      */
  662.     private $isNotificationAssign true;
  663.     /**
  664.      * @ORM\Column(type="boolean", nullable=true)
  665.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding"})
  666.      */
  667.     private $isNotificationChat true;
  668.     /**
  669.      * @ORM\Column(type="boolean", nullable=true)
  670.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding"})
  671.      */
  672.     private $isNotificationFollow true;
  673.     public const STATIC_FIELD_LOCALE 'locale';
  674.     public const STATIC_FIELD_COMPANY 'company';
  675.     public const STATIC_FIELD_JOBTITLE 'jobTitle';
  676.     public const STATIC_FIELD_TIMEZONE 'timezone';
  677.     public const STATIC_FIELD_COUNTRY 'country';
  678.     public const STATIC_FIELD_IMAGENAME 'imageName';
  679.     public const STATIC_FIELD_GLNNUMBER 'glnNumber';
  680.     public const STATIC_FIELD_ACADEMICTITLES 'academicTitles';
  681.     public const STATIC_FIELD_SPECIALTITLES 'specialTitles';
  682.     public const STATIC_FIELD_HEADLINE 'headline';
  683.     public const STATIC_FIELD_CATEGORIES 'categories';
  684.     public const STATIC_FIELD_ISDISPLAYASGUEST 'isDisplayAsGuest';
  685.     public const STATIC_FIELD_ISEXPOSEEMAIL 'isExposeEmail';
  686.     public const STATIC_FIELD_ISALLOWCOMMUNICATION 'isAllowCommunication';
  687.     public const STATIC_FIELD_ISNOTIFICATIONASSIGN 'isNotificationAssign';
  688.     public const STATIC_FIELD_ISNOTIFICATIONCHAT 'isNotificationChat';
  689.     public const STATIC_FIELD_ISNOTIFICATIONCHATGROUP 'isNotificationChatGroup';
  690.     public const STATIC_FIELD_ISNOTIFICATIONFOLLOW 'isNotificationFollow';
  691.     public const STATIC_FIELD_SALINKEDIN 'saLinkedin';
  692.     public const STATIC_FIELD_SATWITTER 'saTwitter';
  693.     public const STATIC_FIELD_SAFACEBOOK 'saFacebook';
  694.     public const STATIC_FIELD_SAINSTAGRAM 'saInstagram';
  695.     public const STATIC_FIELD_SAYOUTUBE 'saYoutube';
  696.     /**
  697.      * @var integer
  698.      * @Groups({"User:Change-Role", "User:Container-Feed-Subscribe"})
  699.      */
  700.     private $containerId;
  701.     /**
  702.      * @var string
  703.      * @Groups({"User:Change-Role"})
  704.      */
  705.     private $roleStr;
  706.     private $container;
  707.     /**
  708.      * @ORM\Column(type="string", length=16, nullable=true)
  709.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me", "User:Attendee-List", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "WatchTime:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead"})
  710.      */
  711.     private $glnNumber;
  712.     /**
  713.      * @ORM\Column(type="integer", nullable=true)
  714.      * @Groups({"User:Read","User:Write","User:Me", "User:Attendee-List", "User:PRead"})
  715.      */
  716.     private $ord;
  717.     /**
  718.      * @ORM\Column(type="integer", nullable=true)
  719.      */
  720.     private $ordState;
  721.     private $oldEmail "";
  722.     /**
  723.      * @ORM\ManyToMany(targetEntity=Conference::class, mappedBy="registeredUsers")
  724.      * @Groups({"User:Me"})
  725.      */
  726.     private $registeredToConferences;
  727.     /**
  728.      * @ORM\Column(type="boolean", nullable=true)
  729.      * @Groups({"User:Exp", "User:Imp", "User:Read","User:Write","User:Me","User:Attendee-List","User:Change-Profile", "User:Change-Login-Onboarding"})
  730.      */
  731.     private $isNotificationChatGroup true;
  732.     /**
  733.      * @ORM\Column(type="string", length=255, nullable=true)
  734.      * @Groups({"User:Ug-Attach"})
  735.      */
  736.     private $inviteCode;
  737.     /**
  738.      * @ORM\ManyToMany(targetEntity=CommonCategory::class)
  739.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "Certificate:Read", "User:Assign-List"})
  740.      */
  741.     private $categories;
  742.     /**
  743.      * @ORM\Column(type="string", length=255, nullable=true)
  744.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List"})
  745.      */
  746.     private $headline;
  747.     /**
  748.      * @ORM\ManyToMany(targetEntity=SpecialTitle::class)
  749.      * @Groups({"User:EL", "User:Exp", "User:Imp", "User:Read","User:Get-Admin","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "Certificate:Read", "User:Assign-List", "User:PRead"})
  750.      */
  751.     private $specialTitles;
  752.     /**
  753.      * @ORM\OneToMany(targetEntity=UserAcademicTitle::class, mappedBy="user", orphanRemoval=true, cascade={"persist"})
  754.      * @Groups({"User:EL", "User:Imp", "User:Read","User:Get-Admin","User:Write","User:Me", "User:Attendee-List", "User:Attendee-List-O", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "Company:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatThread:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "User:PRead", "User:PSRead", "Certificate:Read", "ElLession:Detail", "User:Assign-List", "ElCourseRating:Read", "User:Get-Open"})
  755.      */
  756.     private $userAcademicTitles;
  757.     private ?string $academicTitles "";
  758.     /**
  759.      * @ORM\OneToMany(targetEntity=UserCreditPoint::class, mappedBy="user", orphanRemoval=true)
  760.      */
  761.     private $userCreditPoints;
  762.     /**
  763.      * @ORM\ManyToOne(targetEntity=Container::class)
  764.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  765.      * @Groups({"User:Read","User:Me"})
  766.      */
  767.     private $userContainer;
  768.     /**
  769.      * @ORM\Column(type="string", length=255, nullable=true)
  770.      * @Groups({"User:Read","User:Me"})
  771.      */
  772.     private $userContainerDomain;
  773.     /**
  774.      * @ORM\ManyToMany(targetEntity=EmailChanel::class, inversedBy="users")
  775.      * @Groups({"User:EL", "User:Read","User:Get-Admin","User:Write","User:Me", "User:Change-Profile", "User:Get-Limited","Session:Select","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "EventLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "SessionComment:Read", "Session:Read", "DocFile:Read", "Session:PRead", "Conference:Read", "Conference:PRead", "ElCourse:PRead", "Session:Agenda", "Newsfeed:Read", "NewsfeedComment:Read", "ChatMessage:Read", "Session:VideoLibrary", "VoteResult:Read", "VoteResult:Exp", "SessionQuestion:Read", "Meeting:Read", "MeetingBooking:Read", "Import:Read", "SessionQuestion:Exp", "VoucherCode:Read", "ElCourse:Read", "ElTask:Read", "VideoLibrary:Read", "ElExamAttempt:Read", "ElExamAnswer:Read", "ElCourseJoin:Read", "ElTaskAttempt:Read", "ElExamAttempt:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "VideoGallery:PRead", "SurveyResult:Read", "Certificate:Read", "User:Assign-List"})
  776.      */
  777.     private $unsubscribedEmailChanels;
  778.     /**
  779.      * @ORM\Column(type="boolean", nullable=true)
  780.      * @Groups({"User:Read"})
  781.      */
  782.     private $isUnsubscribedInvite;
  783.     /**
  784.      * @ORM\Column(type="boolean", nullable=true)
  785.      * @Groups({"User:Read", "User:Write"})
  786.      */
  787.     private $isEmailOff;
  788.     /**
  789.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="users")
  790.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  791.      * @Groups({"User:Read", "User:Write", "User:Me", "User:Change-Profile", "User:PRead"})
  792.      */
  793.     private $organization;
  794.     /**
  795.      * @ORM\ManyToMany(targetEntity=Company::class, inversedBy="followers")
  796.      * @ORM\JoinTable(name="rel_user_follow_company")
  797.      * @Groups({"User:Me"})
  798.      */
  799.     private $followingCompanies;
  800.     /**
  801.      * @ORM\ManyToMany(targetEntity=Company::class, inversedBy="offNotificationUsers")
  802.      * @ORM\JoinTable(name="rel_user_notification_company")
  803.      * @Groups({"User:Me"})
  804.      */
  805.     private $offCompanyNotifications;
  806.     /**
  807.      * @var integer
  808.      * @Groups({"User:Follow-Unfollow-Company", "User:Notification-Company"})
  809.      */
  810.     private $companyId;
  811.     /**
  812.      * @ORM\OneToMany(targetEntity=Transaction::class, mappedBy="user")
  813.      */
  814.     private $transactions;
  815.     /**
  816.      * @ORM\ManyToMany(targetEntity=CommonCategory::class, inversedBy="newsfeedSubscribedUsers")
  817.      * @ORM\JoinTable(name="rel_user_newsfeed_subscribe")
  818.      * @Groups({"User:Read","User:Get-Admin","User:Write","User:Me", "User:Change-Profile"})
  819.      */
  820.     private $newsfeedSubscriptions;
  821.     /**
  822.      * @Groups({"User:Read","User:Get-Admin","User:Get-Admin-List","User:Write","User:Me", "User:Change-Profile"})
  823.      */
  824.     private $isUpdateNewsfeedSubscriptions;
  825.     /**
  826.      * @Groups({"User:Feed-Subscribe", "User:Container-Feed-Send"})
  827.      */
  828.     private $newsfeedSubscriptionId;
  829.     /**
  830.      * @ORM\ManyToMany(targetEntity=Container::class)
  831.      * @Groups({"User:Read", "User:Get-Admin","User:Me", "User:Change-Profile"})
  832.      */
  833.     private $newsfeedContainerSubscriptions;
  834.     /**
  835.      * @ORM\OneToMany(targetEntity=DocFileSaved::class, mappedBy="user", orphanRemoval=true)
  836.      * @Groups({"User:Me"})
  837.      */
  838.     private $docFileSaveds;
  839.     public function getContainer()
  840.     {
  841.         return $this->container;
  842.     }
  843.     public function setContainer($container): self
  844.     {
  845.         $this->container $container;
  846.         return $this;
  847.     }
  848.     public function __toString()
  849.     {
  850.         return $this->getFirstName().' '.$this->getLastName();
  851.     }
  852.     public function __construct()
  853.     {
  854.         parent::__construct();
  855.         $this->roles = new ArrayCollection();
  856.         $this->roleContainers = new ArrayCollection();
  857.         $this->userGroups = new ArrayCollection();
  858.         $this->userTags = new ArrayCollection();
  859.         $this->chatThreads = new ArrayCollection();
  860.         $this->elTaskAttempts = new ArrayCollection();
  861.         $this->elCourses = new ArrayCollection();
  862.         $this->elCourseJoins = new ArrayCollection();
  863.         $this->elExamAttempts = new ArrayCollection();
  864.         $this->following = new ArrayCollection();
  865.         $this->followers = new ArrayCollection();
  866.         $this->newsfeedLikes = new ArrayCollection();
  867.         $this->commonCommentLikes = new ArrayCollection();
  868.         $this->sessionQuestionLikes = new ArrayCollection();
  869.         $this->registeredToConferences = new ArrayCollection();
  870.         $this->categories = new ArrayCollection();
  871.         $this->specialTitles = new ArrayCollection();
  872.         $this->userAcademicTitles = new ArrayCollection();
  873.         $this->userCreditPoints = new ArrayCollection();
  874.         $this->unsubscribedEmailChanels = new ArrayCollection();
  875.         $this->followingCompanies = new ArrayCollection();
  876.         $this->offCompanyNotifications = new ArrayCollection();
  877.         $this->transactions = new ArrayCollection();
  878.         $this->newsfeedSubscriptions = new ArrayCollection();
  879.         $this->newsfeedContainerSubscriptions = new ArrayCollection();
  880.         $this->docFileSaveds = new ArrayCollection();
  881.     }
  882.     protected function createTranslation(): TranslationInterface
  883.     {
  884.         return new UserTranslation();
  885.     }
  886.     public function addTranslation(TranslationInterface $translation): void
  887.     {
  888.         $this->setUpdatedAt(new \DateTime());
  889.         parent::addTranslation($translation);
  890.     }
  891.     public function getBiography(): ?string
  892.     {
  893.         return $this->getTranslation()->getBiography();
  894.     }
  895.     public function setBiography(string $biography): self
  896.     {
  897.         $this->getTranslation()->setBiography($biography);
  898.         return $this;
  899.     }
  900.     public function getId(): ?int
  901.     {
  902.         return $this->id;
  903.     }
  904.     public function getEmail(): ?string
  905.     {
  906.         return $this->email;
  907.     }
  908.     public function setEmail(string $email): self
  909.     {
  910.         $this->oldEmail $this->email;
  911.         if (substr($email, -strlen(EsEncrypt::MARKER)) !== EsEncrypt::MARKER) {
  912.             $email strtolower($email);
  913.         }
  914.         $this->email $email;
  915.         return $this;
  916.     }
  917.     public function getOldEmail(): ?string
  918.     {
  919.         return $this->oldEmail;
  920.     }
  921.     public function getUserIdentifier(): string
  922.     {
  923.         return (string) $this->email;
  924.     }
  925.     /**
  926.      * A visual identifier that represents this user.
  927.      *
  928.      * @see UserInterface
  929.      */
  930.     public function getUsername(): string
  931.     {
  932.         return (string) $this->email;
  933.     }
  934.     /**
  935.      * @see UserInterface
  936.      */
  937.     public function getPassword(): string
  938.     {
  939.         return (string) $this->password;
  940.     }
  941.     public function setPassword(string $password): self
  942.     {
  943.         $this->password $password;
  944.         return $this;
  945.     }
  946.     public function getPlainPassword(): ?string
  947.     {
  948.         return $this->plainPassword;
  949.     }
  950.     public function setPlainPassword(string $plainPassword): self
  951.     {
  952.         $this->plainPassword $plainPassword;
  953.         return $this;
  954.     }
  955.     public function getOldPassword(): ?string
  956.     {
  957.         return $this->oldPassword;
  958.     }
  959.     public function setOldPassword(string $oldPassword): self
  960.     {
  961.         $this->oldPassword $oldPassword;
  962.         return $this;
  963.     }
  964.     /**
  965.      * @see UserInterface
  966.      */
  967.     public function getSalt(): ?string
  968.     {
  969.         // not needed when using the "bcrypt" algorithm in security.yaml
  970.         return null;
  971.     }
  972.     /**
  973.      * @see UserInterface
  974.      */
  975.     public function eraseCredentials()
  976.     {
  977.         // If you store any temporary, sensitive data on the user, clear it here
  978.         $this->plainPassword null;
  979.     }
  980.     public function getFirstName(): ?string
  981.     {
  982.         return $this->firstName;
  983.     }
  984.     public function setFirstName(?string $firstName): self
  985.     {
  986.         $this->firstName $firstName;
  987.         return $this;
  988.     }
  989.     public function getLastName(): ?string
  990.     {
  991.         return $this->lastName;
  992.     }
  993.     public function setLastName(?string $lastName): self
  994.     {
  995.         $this->lastName $lastName;
  996.         return $this;
  997.     }
  998.     /**
  999.      * @Groups({"User:EL", "User:Get-Admin","User:Get-Admin-List", "Conference:EL", "Session:EL", "VideoGallery:EL", "ElCourse:EL", "ElTask:EL", "Newsfeed:EL", "DocFile:EL"})
  1000.      * @SerializedName("fullName")
  1001.      */
  1002.     public function getFullName()
  1003.     {
  1004.         $fullName $this->getFirstName();
  1005.         if (!empty($this->lastName)) {
  1006.             $fullName .= ' '.$this->getLastName();
  1007.         }
  1008.         return $fullName;
  1009.     }
  1010.     public function getLocale(): ?string
  1011.     {
  1012.         return $this->locale;
  1013.     }
  1014.     public function setLocale(?string $locale): self
  1015.     {
  1016.         $this->locale $locale;
  1017.         return $this;
  1018.     }
  1019.     public function getClient(): ?Client
  1020.     {
  1021.         return $this->client;
  1022.     }
  1023.     public function setClient(?Client $client): self
  1024.     {
  1025.         $this->client $client;
  1026.         return $this;
  1027.     }
  1028.     public function getStatus(): ?string
  1029.     {
  1030.         return $this->status;
  1031.     }
  1032.     public function setStatus(string $status): self
  1033.     {
  1034.         $this->status $status;
  1035.         return $this;
  1036.     }
  1037.     public function getOldRole()
  1038.     {
  1039.         $roles = [];
  1040.         foreach ($this->roles as $role) {
  1041.             $roles[] = $role->getRole();
  1042.         }
  1043.         return $roles[0] ?? Role::ROLE_USER;
  1044.     }
  1045.     /*
  1046.     public function addRole(Role $role): self
  1047.     {
  1048.         //if (!$this->roles->contains($role)) {
  1049.             //$role->addUser($this);
  1050.             $this->roles = [$role];
  1051.         //}
  1052.         return $this;
  1053.     }
  1054.     */
  1055.     /**
  1056.      * @Groups({"User:Exp", "User:Read", "User:Me"})
  1057.      * @SerializedName("roles")
  1058.      */
  1059.     public function getRolesArray()
  1060.     {
  1061.         $roles = [];
  1062.         foreach ($this->roleContainers as $roleContainer) {
  1063.             // $roles[] = $roleContainer->getRole();
  1064.             if (!empty($this->container) && $this->container->getId() === $roleContainer->getContainer()->getId()) {
  1065.                 $roles[] = $roleContainer->getRole();
  1066.             }
  1067.         }
  1068.         return $roles;
  1069.     }
  1070.     /**
  1071.      * @Groups({"User:Read","User:Get-Admin","User:Get-Admin-List"})
  1072.      * @SerializedName("role")
  1073.      */
  1074.     public function getRole()
  1075.     {
  1076.         $roles = [];
  1077.         foreach ($this->roleContainers as $roleContainer) {
  1078.             // $roles[] = $roleContainer->getRole();
  1079.             if (!empty($this->container) && $this->container->getId() === $roleContainer->getContainer()->getId()) {
  1080.                 $roles[] = $roleContainer->getRole();
  1081.             }
  1082.         }
  1083.         return $roles[0] ?? Role::ROLE_USER;
  1084.     }
  1085.     /**
  1086.      * @return Collection|string[]
  1087.      */
  1088.     public function getRoles()
  1089.     {
  1090.         //return ['ROLE_SUPER_ADMIN'];
  1091.         //return (array)$this->roles;
  1092.         $roles = [];
  1093.         foreach ($this->roleContainers as $roleContainer) {
  1094.             // $roles[] = $roleContainer->getRole();
  1095.             if (!empty($this->container) && $this->container->getId() === $roleContainer->getContainer()->getId()) {
  1096.                 $roles[] = $roleContainer->getRole();
  1097.             }
  1098.         }
  1099.         return $roles;
  1100.     }
  1101.     /**
  1102.      * @return Collection|RoleContainer[]
  1103.      */
  1104.     public function getRoleContainers(): Collection
  1105.     {
  1106.         return $this->roleContainers;
  1107.     }
  1108.     public function addRoleContainer(RoleContainer $roleContainer): self
  1109.     {
  1110.         if (!$this->roleContainers->contains($roleContainer)) {
  1111.             $this->removeRoleContainer(null$roleContainer->getContainer());
  1112.             $this->roleContainers[] = $roleContainer;
  1113.             $roleContainer->setUser($this);
  1114.             if (!empty($this->container) && empty($roleContainer->getContainer())) {
  1115.                 $roleContainer->setContainer($this->container);
  1116.             } elseif (empty($this->container) && isset($GLOBALS['container'])) {
  1117.                 $roleContainer->setContainer($GLOBALS['container']);
  1118.             }
  1119.         }
  1120.         return $this;
  1121.     }
  1122.     /**
  1123.      * @Groups({"User:Imp", "User:Write", "User:Global-Create"})
  1124.      * @SerializedName("role")
  1125.      */
  1126.     public function setRoleContainer($inputRole): self
  1127.     {
  1128.         if (!is_array($inputRole)) {
  1129.             $inputRole = [$inputRole];
  1130.         }
  1131.         foreach ($inputRole as $role) {
  1132.             $found false;
  1133.             $newRoleContainer = new RoleContainer($role);
  1134.             foreach ($this->roleContainers as $roleContainer) {
  1135.                 if (!empty($this->container) && $this->container->getId() === $roleContainer->getContainer()->getId()) {
  1136.                     $roleContainer->setRole($role);
  1137.                     $found true;
  1138.                     break;
  1139.                 }
  1140.             }
  1141.             if (!$found) {
  1142.                 $this->addRoleContainer($newRoleContainer);
  1143.             }
  1144.         }
  1145.         return $this;
  1146.     }
  1147.     public function removeRoleContainer(RoleContainer $roleContainer null$container null): self
  1148.     {
  1149.         if (!empty($roleContainer) && $this->roleContainers->removeElement($roleContainer)) {
  1150.             // set the owning side to null (unless already changed)
  1151.             if ($roleContainer->getUser() === $this) {
  1152.                 $roleContainer->setUser(null);
  1153.             }
  1154.         }
  1155.         if (!empty($container)) {
  1156.             foreach ($this->roleContainers as $roleContainer) {
  1157.                 if ($container->getId() === $roleContainer->getContainer()->getId()) {
  1158.                     $this->roleContainers->removeElement($roleContainer);
  1159.                     if ($roleContainer->getUser() === $this) {
  1160.                         $roleContainer->setUser(null);
  1161.                     }
  1162.                 }
  1163.             }
  1164.         }
  1165.         return $this;
  1166.     }
  1167.     public function hasRoleContainers($inputRole): bool
  1168.     {
  1169.         $inputRole = (is_array($inputRole)) ? $inputRole : [$inputRole];
  1170.         foreach ($this->roleContainers as $er) {
  1171.             foreach ($inputRole as $ir) {
  1172.                 if ($er->getRole() === $ir) {
  1173.                     return true;
  1174.                 }
  1175.             }
  1176.         }
  1177.         return false;
  1178.     }
  1179.     public function hasRoleContainersContainer($containerId): bool
  1180.     {
  1181.         foreach ($this->roleContainers as $erc) {
  1182.             if ($erc->getContainer()->getId() === $containerId) {
  1183.                 return true;
  1184.             }
  1185.         }
  1186.         return false;
  1187.     }
  1188.     /**
  1189.      * @Groups({"User:Imp"})
  1190.      * @SerializedName("roles")
  1191.      */
  1192.     public function setTmpRoles($tmpRoles): self
  1193.     {
  1194.         $this->tmpRoles $tmpRoles;
  1195.         return $this;
  1196.     }
  1197.     public function getTmpRoles(): ?string
  1198.     {
  1199.         return empty($this->tmpRoles) ? RoleContainer::ROLE_USER $this->tmpRoles;
  1200.     }
  1201.     /**
  1202.      * @return Collection|UserGroup[]
  1203.      */
  1204.     public function getUserGroups(): Collection
  1205.     {
  1206.         return $this->userGroups;
  1207.     }
  1208.     public function getUserGroupsArray()
  1209.     {
  1210.         $groups = [];
  1211.         foreach ($this->userGroups as $group) {
  1212.             if (!$group->getIsGenerated()) {
  1213.                 $groups[] = $group->getId();
  1214.             }
  1215.         }
  1216.         return $groups;
  1217.     }
  1218.     public function getUserGroupIds()
  1219.     {
  1220.         $ids = [];
  1221.         foreach ($this->userGroups as $group) {
  1222.             $ids[] = $group->getId();
  1223.         }
  1224.         return $ids;
  1225.     }
  1226.     public function addUserGroup(UserGroup $userGroup): self
  1227.     {
  1228.         if (!$this->hasUserGroup($userGroup)) {
  1229.             $this->userGroups[] = $userGroup;
  1230.         }
  1231.         return $this;
  1232.     }
  1233.     public function setUserGroups($userGroups): self
  1234.     {
  1235.         if ($userGroups) {
  1236.             foreach ($userGroups as $userGroup) {
  1237.                 $this->addUserGroup($userGroup);
  1238.             }
  1239.         }
  1240.         return $this;
  1241.     }
  1242.     public function removeUserGroup(UserGroup $userGroup): self
  1243.     {
  1244.         $this->userGroups->removeElement($userGroup);
  1245.         return $this;
  1246.     }
  1247.     public function hasUserGroup(UserGroup $userGroup): bool
  1248.     {
  1249.         return $this->userGroups->exists(
  1250.             function ($k$v) use ($userGroup) {
  1251.                 return $v->getName() === $userGroup->getName();
  1252.             }
  1253.         );
  1254.     }
  1255.     public function hasContainerUserGroups($container)
  1256.     {
  1257.         foreach ($container->getUserGroups() as $cug) {
  1258.             if ($cug->getIsGenerated() && $this->hasUserGroup($cug)) {
  1259.                 return true;
  1260.             }
  1261.         }
  1262.         return false;
  1263.     }
  1264.     /**
  1265.      * @return Collection|UserTag[]
  1266.      */
  1267.     public function getUserTags(): Collection
  1268.     {
  1269.         return $this->userTags;
  1270.     }
  1271.     /**
  1272.      * @Groups({"User:EL"})
  1273.      * @SerializedName("tags")
  1274.      */
  1275.     public function getTagsArray()
  1276.     {
  1277.         $tags = [];
  1278.         foreach ($this->userTags as $tag) {
  1279.             $tags[] = $tag->getName();
  1280.         }
  1281.         return $tags;
  1282.     }
  1283.     public function addUserTag(UserTag $userTag): self
  1284.     {
  1285.         if (!$this->userTags->contains($userTag)) {
  1286.             $this->userTags[] = $userTag;
  1287.             $userTag->addUser($this);
  1288.         }
  1289.         return $this;
  1290.     }
  1291.     public function removeUserTag(UserTag $userTag): self
  1292.     {
  1293.         if ($this->userTags->removeElement($userTag)) {
  1294.             $userTag->removeUser($this);
  1295.         }
  1296.         return $this;
  1297.     }
  1298.     public function getCompany()
  1299.     {
  1300.         return $this->company;
  1301.     }
  1302.     public function setCompany($company)
  1303.     {
  1304.         $this->company $company;
  1305.         return $this;
  1306.     }
  1307.     public function getJobTitle()
  1308.     {
  1309.         return $this->jobTitle;
  1310.     }
  1311.     public function setJobTitle($jobTitle)
  1312.     {
  1313.         $this->jobTitle $jobTitle;
  1314.         return $this;
  1315.     }
  1316.     public function getImageName(): ?string
  1317.     {
  1318.         return $this->imageName;
  1319.     }
  1320.     public function setImageName(?string $imageName): self
  1321.     {
  1322.         $this->imageName $imageName;
  1323.         return $this;
  1324.     }
  1325.     public function getSource(): ?string
  1326.     {
  1327.         return $this->source;
  1328.     }
  1329.     public function setSource(string $source): self
  1330.     {
  1331.         $this->source $source;
  1332.         return $this;
  1333.     }
  1334.     public function getIsOnboarded(): ?bool
  1335.     {
  1336.         return $this->isOnboarded;
  1337.     }
  1338.     public function setIsOnboarded(?bool $isOnboarded): self
  1339.     {
  1340.         $this->isOnboarded $isOnboarded;
  1341.         return $this;
  1342.     }
  1343.     public function getIsBlocked(): ?bool
  1344.     {
  1345.         return $this->isBlocked;
  1346.     }
  1347.     public function setIsBlocked(?bool $isBlocked): self
  1348.     {
  1349.         $this->isBlocked $isBlocked;
  1350.         return $this;
  1351.     }
  1352.     public function getOnboardedAt(): ?\DateTimeInterface
  1353.     {
  1354.         return $this->onboardedAt;
  1355.     }
  1356.     public function setOnboardedAt(?\DateTimeInterface $onboardedAt): self
  1357.     {
  1358.         $this->onboardedAt $onboardedAt;
  1359.         return $this;
  1360.     }
  1361.     public function getLastLoginAt(): ?\DateTimeInterface
  1362.     {
  1363.         return $this->lastLoginAt;
  1364.     }
  1365.     public function setLastLoginAt(?\DateTimeInterface $lastLoginAt): self
  1366.     {
  1367.         $this->lastLoginAt $lastLoginAt;
  1368.         return $this;
  1369.     }
  1370.     public function getIsDisplayAsGuest(): ?bool
  1371.     {
  1372.         return $this->isDisplayAsGuest;
  1373.     }
  1374.     public function setIsDisplayAsGuest(?bool $isDisplayAsGuest): self
  1375.     {
  1376.         $this->isDisplayAsGuest $isDisplayAsGuest;
  1377.         return $this;
  1378.     }
  1379.     public function getIsExposeEmail(): ?bool
  1380.     {
  1381.         return $this->isExposeEmail;
  1382.     }
  1383.     public function setIsExposeEmail(?bool $isExposeEmail): self
  1384.     {
  1385.         $this->isExposeEmail $isExposeEmail;
  1386.         return $this;
  1387.     }
  1388.     public function getIsAllowCommunication(): ?bool
  1389.     {
  1390.         return $this->isAllowCommunication;
  1391.     }
  1392.     public function setIsAllowCommunication(?bool $isAllowCommunication): self
  1393.     {
  1394.         $this->isAllowCommunication $isAllowCommunication;
  1395.         return $this;
  1396.     }
  1397.     public function getTimezone(): ?string
  1398.     {
  1399.         /*
  1400.         if (empty($this->timezone) && defined('_USER_TIMEZONE_')) {
  1401.             return _USER_TIMEZONE_;
  1402.         }
  1403.         */
  1404.         return $this->timezone;
  1405.     }
  1406.     public function setTimezone(?string $timezone): self
  1407.     {
  1408.         $this->timezone $timezone;
  1409.         return $this;
  1410.     }
  1411.     public function getRelationManager(): ?self
  1412.     {
  1413.         return $this->relationManager;
  1414.     }
  1415.     public function setRelationManager(?self $relationManager): self
  1416.     {
  1417.         $this->relationManager $relationManager;
  1418.         return $this;
  1419.     }
  1420.     public function getRmEmail(): ?string
  1421.     {
  1422.         if (!empty($this->rmEmail)) {
  1423.             return $this->rmEmail;
  1424.         } else {
  1425.             return $this->getRelationManager() ? $this->getRelationManager()->getEmail() : '';
  1426.         }
  1427.     }
  1428.     public function setRmEmail(?string $rmEmail): self
  1429.     {
  1430.         $this->rmEmail $rmEmail;
  1431.         return $this;
  1432.     }
  1433.     /**
  1434.      * @Groups({"User:Read", "User:Me", "User:Attendee-List", "User:Get-Limited","Session:Select", "Meeting:Read", "EventLog:Read","VideoGalleryHistory:Read" , "JobQueue:Read", "AccessLog:Read", "CommonComment:Read", "CommonCommentLike:Read", "SessionQuestionLike:Read", "NewsfeedLike:Read", "SessionReaction:Read", "ChatThread:Read", "Session:Read", "DocFile:Read", "Session:PRead", "ElCourse:Read", "ElTask:Read", "ElExam:Read", "VideoGallery:Read", "VideoGallery:Read-Public", "SessionQuestion:Read", "VideoGallery:PRead"})
  1435.      * @SerializedName("userType")
  1436.      */
  1437.     public function getUserType()
  1438.     {
  1439.         $roles $this->getRoles();
  1440.         if (isset($roles[0])) {
  1441.             return strtolower(substr($roles[0], 5));
  1442.         }
  1443.         return null;
  1444.     }
  1445.     public function getIsPwdGenerated(): ?bool
  1446.     {
  1447.         return $this->isPwdGenerated;
  1448.     }
  1449.     public function setIsPwdGenerated(?bool $isPwdGenerated): self
  1450.     {
  1451.         $this->isPwdGenerated $isPwdGenerated;
  1452.         return $this;
  1453.     }
  1454.     /**
  1455.      * @return Collection|ChatThread[]
  1456.      */
  1457.     public function getChatThreads(): Collection
  1458.     {
  1459.         return $this->chatThreads;
  1460.     }
  1461.     public function addChatThread(ChatThread $chatThread): self
  1462.     {
  1463.         if (!$this->chatThreads->contains($chatThread)) {
  1464.             $this->chatThreads[] = $chatThread;
  1465.             $chatThread->addUsr($this);
  1466.         }
  1467.         return $this;
  1468.     }
  1469.     public function removeChatThread(ChatThread $chatThread): self
  1470.     {
  1471.         if ($this->chatThreads->removeElement($chatThread)) {
  1472.             $chatThread->removeUsr($this);
  1473.         }
  1474.         return $this;
  1475.     }
  1476.     public function getIsOnline(): ?bool
  1477.     {
  1478.         return $this->isOnline;
  1479.     }
  1480.     public function setIsOnline(?bool $isOnline): self
  1481.     {
  1482.         $this->isOnline $isOnline;
  1483.         return $this;
  1484.     }
  1485.     public function getIsShowDisclaimer(): ?bool
  1486.     {
  1487.         return $this->isShowDisclaimer;
  1488.     }
  1489.     public function setIsShowDisclaimer(?bool $isShowDisclaimer): self
  1490.     {
  1491.         $this->isShowDisclaimer $isShowDisclaimer;
  1492.         return $this;
  1493.     }
  1494.     public function setSamlAttributes(array $attributes)
  1495.     {
  1496.         $this->samlAttributes $attributes;
  1497.     }
  1498.     public function getSamlAttributes()
  1499.     {
  1500.         return $this->samlAttributes;
  1501.     }
  1502.     public function getSaLinkedin(): ?string
  1503.     {
  1504.         return $this->saLinkedin;
  1505.     }
  1506.     public function setSaLinkedin(?string $saLinkedin): self
  1507.     {
  1508.         $this->saLinkedin $saLinkedin;
  1509.         return $this;
  1510.     }
  1511.     public function getSaTwitter(): ?string
  1512.     {
  1513.         return $this->saTwitter;
  1514.     }
  1515.     public function setSaTwitter(?string $saTwitter): self
  1516.     {
  1517.         $this->saTwitter $saTwitter;
  1518.         return $this;
  1519.     }
  1520.     public function getSaFacebook(): ?string
  1521.     {
  1522.         return $this->saFacebook;
  1523.     }
  1524.     public function setSaFacebook(?string $saFacebook): self
  1525.     {
  1526.         $this->saFacebook $saFacebook;
  1527.         return $this;
  1528.     }
  1529.     public function getSaInstagram(): ?string
  1530.     {
  1531.         return $this->saInstagram;
  1532.     }
  1533.     public function setSaInstagram(?string $saInstagram): self
  1534.     {
  1535.         $this->saInstagram $saInstagram;
  1536.         return $this;
  1537.     }
  1538.     public function getSaYoutube(): ?string
  1539.     {
  1540.         return $this->saYoutube;
  1541.     }
  1542.     public function setSaYoutube(?string $saYoutube): self
  1543.     {
  1544.         $this->saYoutube $saYoutube;
  1545.         return $this;
  1546.     }
  1547.     /**
  1548.      * @return Collection|ElTaskAttempt[]
  1549.      */
  1550.     public function getElTaskAttempts(): Collection
  1551.     {
  1552.         return $this->elTaskAttempts;
  1553.     }
  1554.     public function addElTaskAttempt(ElTaskAttempt $elTaskAttempt): self
  1555.     {
  1556.         if (!$this->elTaskAttempts->contains($elTaskAttempt)) {
  1557.             $this->elTaskAttempts[] = $elTaskAttempt;
  1558.             $elTaskAttempt->setUser($this);
  1559.         }
  1560.         return $this;
  1561.     }
  1562.     public function removeElTaskAttempt(ElTaskAttempt $elTaskAttempt): self
  1563.     {
  1564.         if ($this->elTaskAttempts->removeElement($elTaskAttempt)) {
  1565.             // set the owning side to null (unless already changed)
  1566.             if ($elTaskAttempt->getUser() === $this) {
  1567.                 $elTaskAttempt->setUser(null);
  1568.             }
  1569.         }
  1570.         return $this;
  1571.     }
  1572.     /**
  1573.      * @return Collection|ElCourse[]
  1574.      */
  1575.     public function getElCourses(): Collection
  1576.     {
  1577.         return $this->elCourses;
  1578.     }
  1579.     public function addElCourse(ElCourse $elCourse): self
  1580.     {
  1581.         if (!$this->elCourses->contains($elCourse)) {
  1582.             $this->elCourses[] = $elCourse;
  1583.             $elCourse->addUser($this);
  1584.         }
  1585.         return $this;
  1586.     }
  1587.     public function removeElCourse(ElCourse $elCourse): self
  1588.     {
  1589.         if ($this->elCourses->removeElement($elCourse)) {
  1590.             $elCourse->removeUser($this);
  1591.         }
  1592.         return $this;
  1593.     }
  1594.     /**
  1595.      * @return Collection|ElCourseJoin[]
  1596.      */
  1597.     public function getElCourseJoins(): Collection
  1598.     {
  1599.         return $this->elCourseJoins;
  1600.     }
  1601.     public function addElCourseJoin(ElCourseJoin $elCourseJoin): self
  1602.     {
  1603.         if (!$this->elCourseJoins->contains($elCourseJoin)) {
  1604.             $this->elCourseJoins[] = $elCourseJoin;
  1605.             $elCourseJoin->setUser($this);
  1606.         }
  1607.         return $this;
  1608.     }
  1609.     public function removeElCourseJoin(ElCourseJoin $elCourseJoin): self
  1610.     {
  1611.         if ($this->elCourseJoins->removeElement($elCourseJoin)) {
  1612.             // set the owning side to null (unless already changed)
  1613.             if ($elCourseJoin->getUser() === $this) {
  1614.                 $elCourseJoin->setUser(null);
  1615.             }
  1616.         }
  1617.         return $this;
  1618.     }
  1619.     /**
  1620.      * @return Collection|ElExamAttempt[]
  1621.      */
  1622.     public function getElExamAttempts(): Collection
  1623.     {
  1624.         return $this->elExamAttempts;
  1625.     }
  1626.     public function addElExamAttempt(ElExamAttempt $elExamAttempt): self
  1627.     {
  1628.         if (!$this->elExamAttempts->contains($elExamAttempt)) {
  1629.             $this->elExamAttempts[] = $elExamAttempt;
  1630.             $elExamAttempt->setUser($this);
  1631.         }
  1632.         return $this;
  1633.     }
  1634.     public function removeElExamAttempt(ElExamAttempt $elExamAttempt): self
  1635.     {
  1636.         if ($this->elExamAttempts->removeElement($elExamAttempt)) {
  1637.             // set the owning side to null (unless already changed)
  1638.             if ($elExamAttempt->getUser() === $this) {
  1639.                 $elExamAttempt->setUser(null);
  1640.             }
  1641.         }
  1642.         return $this;
  1643.     }
  1644.     public function getCountry(): ?string
  1645.     {
  1646.         return $this->country;
  1647.     }
  1648.     public function setCountry(?string $country): self
  1649.     {
  1650.         $this->country $country;
  1651.         return $this;
  1652.     }
  1653.     public function getFailAttemptCount(): ?int
  1654.     {
  1655.         return $this->failAttemptCount;
  1656.     }
  1657.     public function setFailAttemptCount(?int $failAttemptCount): self
  1658.     {
  1659.         $this->failAttemptCount $failAttemptCount;
  1660.         return $this;
  1661.     }
  1662.     public function getLastFailAttemptAt(): ?\DateTimeInterface
  1663.     {
  1664.         return $this->lastFailAttemptAt;
  1665.     }
  1666.     public function setLastFailAttemptAt(?\DateTimeInterface $lastFailAttemptAt): self
  1667.     {
  1668.         $this->lastFailAttemptAt $lastFailAttemptAt;
  1669.         return $this;
  1670.     }
  1671.     public function getLoginBlockUntilAt(): ?\DateTimeInterface
  1672.     {
  1673.         return $this->loginBlockUntilAt;
  1674.     }
  1675.     public function setLoginBlockUntilAt(?\DateTimeInterface $loginBlockUntilAt): self
  1676.     {
  1677.         $this->loginBlockUntilAt $loginBlockUntilAt;
  1678.         return $this;
  1679.     }
  1680.     public function getIsConsiderSpeaker(): ?bool
  1681.     {
  1682.         return $this->isConsiderSpeaker;
  1683.     }
  1684.     public function setIsConsiderSpeaker(?bool $isConsiderSpeaker): self
  1685.     {
  1686.         $this->isConsiderSpeaker $isConsiderSpeaker;
  1687.         return $this;
  1688.     }
  1689.     public function getIsConsiderModerator(): ?bool
  1690.     {
  1691.         return $this->isConsiderModerator;
  1692.     }
  1693.     public function setIsConsiderModerator(?bool $isConsiderModerator): self
  1694.     {
  1695.         $this->isConsiderModerator $isConsiderModerator;
  1696.         return $this;
  1697.     }
  1698.     /**
  1699.      * @return Collection|self[]
  1700.      */
  1701.     public function getFollowing(): Collection
  1702.     {
  1703.         return $this->following;
  1704.     }
  1705.     public function addFollowing(self $following): self
  1706.     {
  1707.         if (!$this->following->contains($following)) {
  1708.             $this->following[] = $following;
  1709.         }
  1710.         return $this;
  1711.     }
  1712.     public function removeFollowing(self $following): self
  1713.     {
  1714.         $this->following->removeElement($following);
  1715.         return $this;
  1716.     }
  1717.     /**
  1718.      * @return Collection|self[]
  1719.      */
  1720.     public function getFollowers(): Collection
  1721.     {
  1722.         return $this->followers;
  1723.     }
  1724.     public function addFollower(self $follower): self
  1725.     {
  1726.         if (!$this->followers->contains($follower)) {
  1727.             $this->followers[] = $follower;
  1728.             $follower->addFollowing($this);
  1729.         }
  1730.         return $this;
  1731.     }
  1732.     public function removeFollower(self $follower): self
  1733.     {
  1734.         if ($this->followers->removeElement($follower)) {
  1735.             $follower->removeFollowing($this);
  1736.         }
  1737.         return $this;
  1738.     }
  1739.     /**
  1740.      * @return  integer
  1741.      */
  1742.     public function getFolowUnfollowUserId()
  1743.     {
  1744.         return $this->folowUnfollowUserId;
  1745.     }
  1746.     /**
  1747.      * @param  integer  $folowUnfollowUserId
  1748.      *
  1749.      * @return  self
  1750.      */
  1751.     public function setFolowUnfollowUserId($folowUnfollowUserId)
  1752.     {
  1753.         $this->folowUnfollowUserId $folowUnfollowUserId;
  1754.         return $this;
  1755.     }
  1756.     /**
  1757.      * @return  bool
  1758.      */
  1759.     public function getIsUnfollow()
  1760.     {
  1761.         return $this->isUnfollow;
  1762.     }
  1763.     /**
  1764.      * @param  bool  $isUnfollow
  1765.      *
  1766.      * @return  self
  1767.      */
  1768.     public function setIsUnfollow(bool $isUnfollow)
  1769.     {
  1770.         $this->isUnfollow $isUnfollow;
  1771.         return $this;
  1772.     }
  1773.     public function getMetadata()
  1774.     {
  1775.         return [
  1776.             'id' => $this->getId(),
  1777.             'firstName' => $this->getFirstName(),
  1778.             'lastName' => $this->getLastName(),
  1779.             'jobTitle' => $this->getJobTitle(),
  1780.             'company' => $this->getCompany(),
  1781.             'country' => $this->getCountry(),
  1782.             'userType' => $this->getUserType(),
  1783.             'imageName' => $this->getImageName()
  1784.         ];
  1785.     }
  1786.     /**
  1787.      * @return Collection|NewsfeedLike[]
  1788.      */
  1789.     public function getNewsfeedLikes(): Collection
  1790.     {
  1791.         return $this->newsfeedLikes;
  1792.     }
  1793.     public function addNewsfeedLike(NewsfeedLike $newsfeedLike): self
  1794.     {
  1795.         if (!$this->newsfeedLikes->contains($newsfeedLike)) {
  1796.             $this->newsfeedLikes[] = $newsfeedLike;
  1797.             $newsfeedLike->setUser($this);
  1798.         }
  1799.         return $this;
  1800.     }
  1801.     public function removeNewsfeedLike(NewsfeedLike $newsfeedLike): self
  1802.     {
  1803.         if ($this->newsfeedLikes->removeElement($newsfeedLike)) {
  1804.             // set the owning side to null (unless already changed)
  1805.             if ($newsfeedLike->getUser() === $this) {
  1806.                 $newsfeedLike->setUser(null);
  1807.             }
  1808.         }
  1809.         return $this;
  1810.     }
  1811.     /**
  1812.      * @return Collection|CommonCommentLike[]
  1813.      */
  1814.     public function getCommonCommentLikes(): Collection
  1815.     {
  1816.         return $this->commonCommentLikes;
  1817.     }
  1818.     public function addCommonCommentLike(CommonCommentLike $commonCommentLike): self
  1819.     {
  1820.         if (!$this->commonCommentLikes->contains($commonCommentLike)) {
  1821.             $this->commonCommentLikes[] = $commonCommentLike;
  1822.             $commonCommentLike->setUser($this);
  1823.         }
  1824.         return $this;
  1825.     }
  1826.     public function removeCommonCommentLike(CommonCommentLike $commonCommentLike): self
  1827.     {
  1828.         if ($this->commonCommentLikes->removeElement($commonCommentLike)) {
  1829.             // set the owning side to null (unless already changed)
  1830.             if ($commonCommentLike->getUser() === $this) {
  1831.                 $commonCommentLike->setUser(null);
  1832.             }
  1833.         }
  1834.         return $this;
  1835.     }
  1836.     /**
  1837.      * @return Collection|SessionQuestionLike[]
  1838.      */
  1839.     public function getSessionQuestionLikes(): Collection
  1840.     {
  1841.         return $this->sessionQuestionLikes;
  1842.     }
  1843.     public function addSessionQuestionLike(SessionQuestionLike $sessionQuestionLike): self
  1844.     {
  1845.         if (!$this->sessionQuestionLikes->contains($sessionQuestionLike)) {
  1846.             $this->sessionQuestionLikes[] = $sessionQuestionLike;
  1847.             $sessionQuestionLike->setUser($this);
  1848.         }
  1849.         return $this;
  1850.     }
  1851.     public function removeSessionQuestionLike(SessionQuestionLike $sessionQuestionLike): self
  1852.     {
  1853.         if ($this->sessionQuestionLikes->removeElement($sessionQuestionLike)) {
  1854.             // set the owning side to null (unless already changed)
  1855.             if ($sessionQuestionLike->getUser() === $this) {
  1856.                 $sessionQuestionLike->setUser(null);
  1857.             }
  1858.         }
  1859.         return $this;
  1860.     }
  1861.     public function getIsShowPublic(): ?bool
  1862.     {
  1863.         return $this->isShowPublic;
  1864.     }
  1865.     public function setIsShowPublic(?bool $isShowPublic): self
  1866.     {
  1867.         $this->isShowPublic $isShowPublic;
  1868.         return $this;
  1869.     }
  1870.     public function getIsNotificationAssign(): ?bool
  1871.     {
  1872.         return $this->isNotificationAssign;
  1873.     }
  1874.     public function setIsNotificationAssign(?bool $isNotificationAssign): self
  1875.     {
  1876.         $this->isNotificationAssign $isNotificationAssign;
  1877.         return $this;
  1878.     }
  1879.     public function getIsNotificationChat(): ?bool
  1880.     {
  1881.         return $this->isNotificationChat;
  1882.     }
  1883.     public function setIsNotificationChat(?bool $isNotificationChat): self
  1884.     {
  1885.         $this->isNotificationChat $isNotificationChat;
  1886.         return $this;
  1887.     }
  1888.     public function getIsNotificationFollow(): ?bool
  1889.     {
  1890.         return $this->isNotificationFollow;
  1891.     }
  1892.     public function setIsNotificationFollow(?bool $isNotificationFollow): self
  1893.     {
  1894.         $this->isNotificationFollow $isNotificationFollow;
  1895.         return $this;
  1896.     }
  1897.     /**
  1898.      * Get the value of containerId
  1899.      *
  1900.      * @return  integer
  1901.      */
  1902.     public function getContainerId()
  1903.     {
  1904.         return $this->containerId;
  1905.     }
  1906.     /**
  1907.      * Set the value of containerId
  1908.      *
  1909.      * @param  integer  $containerId
  1910.      *
  1911.      * @return  self
  1912.      */
  1913.     public function setContainerId($containerId)
  1914.     {
  1915.         $this->containerId $containerId;
  1916.         return $this;
  1917.     }
  1918.     /**
  1919.      * Get the value of roleStr
  1920.      *
  1921.      * @return  string
  1922.      */
  1923.     public function getRoleStr()
  1924.     {
  1925.         return $this->roleStr;
  1926.     }
  1927.     /**
  1928.      * Set the value of roleStr
  1929.      *
  1930.      * @param  string  $roleStr
  1931.      *
  1932.      * @return  self
  1933.      */
  1934.     public function setRoleStr(string $roleStr)
  1935.     {
  1936.         $this->roleStr $roleStr;
  1937.         return $this;
  1938.     }
  1939.     public function getGlnNumber(): ?string
  1940.     {
  1941.         return $this->glnNumber;
  1942.     }
  1943.     public function setGlnNumber(?string $glnNumber): self
  1944.     {
  1945.         $this->glnNumber $glnNumber;
  1946.         return $this;
  1947.     }
  1948.     public function getOrd(): ?int
  1949.     {
  1950.         return $this->ord;
  1951.     }
  1952.     public function setOrd(?int $ord): self
  1953.     {
  1954.         $this->ord $ord;
  1955.         $this->setOrdState($ord 1);
  1956.         return $this;
  1957.     }
  1958.     public function getOrdState(): ?int
  1959.     {
  1960.         return $this->ordState;
  1961.     }
  1962.     public function setOrdState(?int $ordState): self
  1963.     {
  1964.         $this->ordState $ordState;
  1965.         return $this;
  1966.     }
  1967.     /**
  1968.      * @return Collection<int, Conference>
  1969.      */
  1970.     public function getRegisteredToConferences(): Collection
  1971.     {
  1972.         return $this->registeredToConferences;
  1973.     }
  1974.     public function addRegisteredToConference(Conference $registeredToConference): self
  1975.     {
  1976.         if (!$this->registeredToConferences->contains($registeredToConference)) {
  1977.             $this->registeredToConferences[] = $registeredToConference;
  1978.             $registeredToConference->addRegisteredUser($this);
  1979.         }
  1980.         return $this;
  1981.     }
  1982.     public function removeRegisteredToConference(Conference $registeredToConference): self
  1983.     {
  1984.         if ($this->registeredToConferences->removeElement($registeredToConference)) {
  1985.             $registeredToConference->removeRegisteredUser($this);
  1986.         }
  1987.         return $this;
  1988.     }
  1989.     public function isIsNotificationChatGroup(): ?bool
  1990.     {
  1991.         return $this->isNotificationChatGroup;
  1992.     }
  1993.     public function setIsNotificationChatGroup(?bool $isNotificationChatGroup): self
  1994.     {
  1995.         $this->isNotificationChatGroup $isNotificationChatGroup;
  1996.         return $this;
  1997.     }
  1998.     /**
  1999.      * @Groups({"User:EL"})
  2000.      */
  2001.     public function getCliId()
  2002.     {
  2003.         return $this->client->getId();
  2004.     }
  2005.     public function getQueueInfo(): array
  2006.     {
  2007.         return [
  2008.             'type' => 'User',
  2009.             'id' => $this->getId()
  2010.         ];
  2011.     }
  2012.     public function getInviteCode(): ?string
  2013.     {
  2014.         return $this->inviteCode;
  2015.     }
  2016.     public function setInviteCode(?string $inviteCode): self
  2017.     {
  2018.         $this->inviteCode $inviteCode;
  2019.         return $this;
  2020.     }
  2021.     /**
  2022.      * @return Collection<int, CommonCategory>
  2023.      */
  2024.     public function getCategories(): Collection
  2025.     {
  2026.         return $this->categories;
  2027.     }
  2028.     public function addCategory(CommonCategory $category): self
  2029.     {
  2030.         if (!$this->categories->contains($category)) {
  2031.             $this->categories[] = $category;
  2032.         }
  2033.         return $this;
  2034.     }
  2035.     public function removeCategory(CommonCategory $category): self
  2036.     {
  2037.         $this->categories->removeElement($category);
  2038.         return $this;
  2039.     }
  2040.     public function getHeadline(): ?string
  2041.     {
  2042.         return $this->headline;
  2043.     }
  2044.     public function setHeadline(?string $headline): self
  2045.     {
  2046.         $this->headline $headline;
  2047.         return $this;
  2048.     }
  2049.     /**
  2050.      * @return Collection<int, SpecialTitle>
  2051.      */
  2052.     public function getSpecialTitles(): Collection
  2053.     {
  2054.         return $this->specialTitles;
  2055.     }
  2056.     public function addSpecialTitle(SpecialTitle $specialTitle): self
  2057.     {
  2058.         if (!$this->specialTitles->contains($specialTitle)) {
  2059.             $this->specialTitles[] = $specialTitle;
  2060.         }
  2061.         return $this;
  2062.     }
  2063.     public function removeSpecialTitle(SpecialTitle $specialTitle): self
  2064.     {
  2065.         $this->specialTitles->removeElement($specialTitle);
  2066.         return $this;
  2067.     }
  2068.     /**
  2069.      * @return Collection<int, UserAcademicTitle>
  2070.      */
  2071.     public function getUserAcademicTitles(): Collection
  2072.     {
  2073.         return $this->userAcademicTitles;
  2074.     }
  2075.     public function addUserAcademicTitle(UserAcademicTitle $userAcademicTitle): self
  2076.     {
  2077.         if (!$this->userAcademicTitles->contains($userAcademicTitle)) {
  2078.             $this->userAcademicTitles[] = $userAcademicTitle;
  2079.             $userAcademicTitle->setUser($this);
  2080.         }
  2081.         return $this;
  2082.     }
  2083.     public function removeUserAcademicTitle(UserAcademicTitle $userAcademicTitle): self
  2084.     {
  2085.         // if ($this->userAcademicTitles->removeElement($userAcademicTitle)) {
  2086.         //     // set the owning side to null (unless already changed)
  2087.         //     if ($userAcademicTitle->getUser() === $this) {
  2088.         //         $userAcademicTitle->setUser(null);
  2089.         //     }
  2090.         // }
  2091.         $this->userAcademicTitles->removeElement($userAcademicTitle);
  2092.         return $this;
  2093.     }
  2094.     public function removeAllUserAcademicTitle(): self
  2095.     {
  2096.         $this->userAcademicTitles->clear();
  2097.         return $this;
  2098.     }
  2099.     /**
  2100.      * @Groups({"User:Exp"})
  2101.      * @SerializedName("academicTitles")
  2102.      */
  2103.     public function getAcademicTitles()
  2104.     {
  2105.         $ats = [];
  2106.         foreach ($this->userAcademicTitles as $at) {
  2107.             $ats[] = $at->getAcademicTitle()->getId();
  2108.         }
  2109.         return implode(","$ats);
  2110.     }
  2111.     /**
  2112.      * @Groups({"User:Imp"})
  2113.      * @SerializedName("academicTitles")
  2114.      */
  2115.     public function setAcademicTitles(?string $academicTitles)
  2116.     {
  2117.         $this->academicTitles $academicTitles;
  2118.     }
  2119.     /**
  2120.      * @return Collection<int, UserCreditPoint>
  2121.      */
  2122.     public function getUserCreditPoints(): Collection
  2123.     {
  2124.         return $this->userCreditPoints;
  2125.     }
  2126.     public function addUserCreditPoint(UserCreditPoint $userCreditPoint): self
  2127.     {
  2128.         if (!$this->userCreditPoints->contains($userCreditPoint)) {
  2129.             $this->userCreditPoints[] = $userCreditPoint;
  2130.             $userCreditPoint->setUser($this);
  2131.         }
  2132.         return $this;
  2133.     }
  2134.     public function removeUserCreditPoint(UserCreditPoint $userCreditPoint): self
  2135.     {
  2136.         if ($this->userCreditPoints->removeElement($userCreditPoint)) {
  2137.             // set the owning side to null (unless already changed)
  2138.             if ($userCreditPoint->getUser() === $this) {
  2139.                 $userCreditPoint->setUser(null);
  2140.             }
  2141.         }
  2142.         return $this;
  2143.     }
  2144.     /**
  2145.      * @Groups({"Newsfeed:EL"})
  2146.      */
  2147.     public function getAcademicTitleFull()
  2148.     {
  2149.         $ats = [];
  2150.         foreach ($this->userAcademicTitles as $at) {
  2151.             $ats[] = $at->getAcademicTitle()->getName();
  2152.         }
  2153.         return implode(" "$ats);
  2154.     }
  2155.     public function getUserContainer(): ?Container
  2156.     {
  2157.         return $this->userContainer;
  2158.     }
  2159.     public function setUserContainer(?Container $userContainer): self
  2160.     {
  2161.         $this->userContainer $userContainer;
  2162.         if ($userContainer) {
  2163.             $this->setUserContainerDomain($userContainer->getDomain());
  2164.         }
  2165.         return $this;
  2166.     }
  2167.     public function getUserContainerDomain(): ?string
  2168.     {
  2169.         return $this->userContainerDomain;
  2170.     }
  2171.     public function setUserContainerDomain(?string $userContainerDomain): self
  2172.     {
  2173.         $this->userContainerDomain $userContainerDomain;
  2174.         return $this;
  2175.     }
  2176.     /**
  2177.      * @return Collection<int, EmailChanel>
  2178.      */
  2179.     public function getUnsubscribedEmailChanels(): Collection
  2180.     {
  2181.         return $this->unsubscribedEmailChanels;
  2182.     }
  2183.     public function addUnsubscribedEmailChanel(EmailChanel $unsubscribedEmailChanel): self
  2184.     {
  2185.         if (!$this->unsubscribedEmailChanels->contains($unsubscribedEmailChanel)) {
  2186.             $this->unsubscribedEmailChanels[] = $unsubscribedEmailChanel;
  2187.         }
  2188.         return $this;
  2189.     }
  2190.     public function removeUnsubscribedEmailChanel(EmailChanel $unsubscribedEmailChanel): self
  2191.     {
  2192.         $this->unsubscribedEmailChanels->removeElement($unsubscribedEmailChanel);
  2193.         return $this;
  2194.     }
  2195.     public function getIsUnsubscribedInvite(): ?bool
  2196.     {
  2197.         return $this->isUnsubscribedInvite;
  2198.     }
  2199.     public function setIsUnsubscribedInvite(?bool $isUnsubscribedInvite): self
  2200.     {
  2201.         $this->isUnsubscribedInvite $isUnsubscribedInvite;
  2202.         return $this;
  2203.     }
  2204.     public function getIsEmailOff(): ?bool
  2205.     {
  2206.         return $this->isEmailOff;
  2207.     }
  2208.     public function setIsEmailOff(?bool $isEmailOff): self
  2209.     {
  2210.         $this->isEmailOff $isEmailOff;
  2211.         return $this;
  2212.     }
  2213.     public function getOrganization(): ?Company
  2214.     {
  2215.         return $this->organization;
  2216.     }
  2217.     public function setOrganization(?Company $organization): self
  2218.     {
  2219.         $this->organization $organization;
  2220.         return $this;
  2221.     }
  2222.     /**
  2223.      * @return Collection<int, Company>
  2224.      */
  2225.     public function getFollowingCompanies(): Collection
  2226.     {
  2227.         return $this->followingCompanies;
  2228.     }
  2229.     public function addFollowingCompany(Company $followingCompany): self
  2230.     {
  2231.         if (!$this->followingCompanies->contains($followingCompany)) {
  2232.             $this->followingCompanies[] = $followingCompany;
  2233.         }
  2234.         return $this;
  2235.     }
  2236.     public function removeFollowingCompany(Company $followingCompany): self
  2237.     {
  2238.         $this->followingCompanies->removeElement($followingCompany);
  2239.         return $this;
  2240.     }
  2241.     public function hasFollowingCompany(Company $followingCompany): bool
  2242.     {
  2243.         return $this->followingCompanies->contains($followingCompany);
  2244.     }
  2245.     /**
  2246.      * @return Collection<int, Company>
  2247.      */
  2248.     public function getOffCompanyNotifications(): Collection
  2249.     {
  2250.         return $this->offCompanyNotifications;
  2251.     }
  2252.     public function addOffCompanyNotification(Company $offCompanyNotification): self
  2253.     {
  2254.         if (!$this->offCompanyNotifications->contains($offCompanyNotification)) {
  2255.             $this->offCompanyNotifications[] = $offCompanyNotification;
  2256.         }
  2257.         return $this;
  2258.     }
  2259.     public function removeOffCompanyNotification(Company $offCompanyNotification): self
  2260.     {
  2261.         $this->offCompanyNotifications->removeElement($offCompanyNotification);
  2262.         return $this;
  2263.     }
  2264.     public function hasOffCompanyNotification(Company $offCompanyNotification): bool
  2265.     {
  2266.         return $this->offCompanyNotifications->contains($offCompanyNotification);
  2267.     }
  2268.     /**
  2269.      * Get the value of companyId
  2270.      *
  2271.      * @return  integer
  2272.      */
  2273.     public function getCompanyId()
  2274.     {
  2275.         return $this->companyId;
  2276.     }
  2277.     /**
  2278.      * Set the value of companyId
  2279.      *
  2280.      * @param  integer  $companyId
  2281.      *
  2282.      * @return  self
  2283.      */
  2284.     public function setCompanyId($companyId)
  2285.     {
  2286.         $this->companyId $companyId;
  2287.         return $this;
  2288.     }
  2289.     public function getImageUrl()
  2290.     {
  2291.         return $this->imageUrl;
  2292.     }
  2293.     public function setImageUrl($imageUrl)
  2294.     {
  2295.         $this->imageUrl $imageUrl;
  2296.         return $this;
  2297.     }
  2298.     /**
  2299.      * @return Collection<int, Transaction>
  2300.      */
  2301.     public function getTransactions(): Collection
  2302.     {
  2303.         return $this->transactions;
  2304.     }
  2305.     public function addTransaction(Transaction $transaction): self
  2306.     {
  2307.         if (!$this->transactions->contains($transaction)) {
  2308.             $this->transactions[] = $transaction;
  2309.             $transaction->setUser($this);
  2310.         }
  2311.         return $this;
  2312.     }
  2313.     public function removeTransaction(Transaction $transaction): self
  2314.     {
  2315.         if ($this->transactions->removeElement($transaction)) {
  2316.             // set the owning side to null (unless already changed)
  2317.             if ($transaction->getUser() === $this) {
  2318.                 $transaction->setUser(null);
  2319.             }
  2320.         }
  2321.         return $this;
  2322.     }
  2323.     /**
  2324.      * @return Collection<int, CommonCategory>
  2325.      */
  2326.     public function getNewsfeedSubscriptions(): Collection
  2327.     {
  2328.         return $this->newsfeedSubscriptions;
  2329.     }
  2330.     public function addNewsfeedSubscription(CommonCategory $newsfeedSubscription): self
  2331.     {
  2332.         if (!$this->newsfeedSubscriptions->contains($newsfeedSubscription)) {
  2333.             $this->newsfeedSubscriptions[] = $newsfeedSubscription;
  2334.         }
  2335.         return $this;
  2336.     }
  2337.     public function removeNewsfeedSubscription(CommonCategory $newsfeedSubscription): self
  2338.     {
  2339.         $this->newsfeedSubscriptions->removeElement($newsfeedSubscription);
  2340.         return $this;
  2341.     }
  2342.     public function hasNewsfeedSubscription(CommonCategory $newsfeedSubscription): bool
  2343.     {
  2344.         return $this->newsfeedSubscriptions->contains($newsfeedSubscription);
  2345.     }
  2346.     public function getIsUpdateNewsfeedSubscriptions()
  2347.     {
  2348.         return $this->isUpdateNewsfeedSubscriptions;
  2349.     }
  2350.     public function setIsUpdateNewsfeedSubscriptions($isUpdateNewsfeedSubscriptions)
  2351.     {
  2352.         $this->isUpdateNewsfeedSubscriptions $isUpdateNewsfeedSubscriptions;
  2353.         return $this;
  2354.     }
  2355.     public function getNewsfeedSubscriptionId()
  2356.     {
  2357.         return $this->newsfeedSubscriptionId;
  2358.     }
  2359.     public function setNewsfeedSubscriptionId($newsfeedSubscriptionId)
  2360.     {
  2361.         $this->newsfeedSubscriptionId $newsfeedSubscriptionId;
  2362.         return $this;
  2363.     }
  2364.     /**
  2365.      * @return Collection<int, Container>
  2366.      */
  2367.     public function getNewsfeedContainerSubscriptions(): Collection
  2368.     {
  2369.         return $this->newsfeedContainerSubscriptions;
  2370.     }
  2371.     public function addNewsfeedContainerSubscription(Container $newsfeedContainerSubscription): self
  2372.     {
  2373.         if (!$this->newsfeedContainerSubscriptions->contains($newsfeedContainerSubscription)) {
  2374.             $this->newsfeedContainerSubscriptions[] = $newsfeedContainerSubscription;
  2375.         }
  2376.         return $this;
  2377.     }
  2378.     public function removeNewsfeedContainerSubscription(Container $newsfeedContainerSubscription): self
  2379.     {
  2380.         $this->newsfeedContainerSubscriptions->removeElement($newsfeedContainerSubscription);
  2381.         return $this;
  2382.     }
  2383.     public function hasNewsfeedContainerSubscription(Container $newsfeedContainerSubscription): bool
  2384.     {
  2385.         return $this->newsfeedContainerSubscriptions->contains($newsfeedContainerSubscription);
  2386.     }
  2387.     /**
  2388.      * @return Collection<int, DocFileSaved>
  2389.      */
  2390.     public function getDocFileSaveds(): Collection
  2391.     {
  2392.         return $this->docFileSaveds;
  2393.     }
  2394.     public function addDocFileSaved(DocFileSaved $docFileSaved): self
  2395.     {
  2396.         if (!$this->docFileSaveds->contains($docFileSaved)) {
  2397.             $this->docFileSaveds[] = $docFileSaved;
  2398.             $docFileSaved->setUser($this);
  2399.         }
  2400.         return $this;
  2401.     }
  2402.     public function removeDocFileSaved(DocFileSaved $docFileSaved): self
  2403.     {
  2404.         if ($this->docFileSaveds->removeElement($docFileSaved)) {
  2405.             // set the owning side to null (unless already changed)
  2406.             if ($docFileSaved->getUser() === $this) {
  2407.                 $docFileSaved->setUser(null);
  2408.             }
  2409.         }
  2410.         return $this;
  2411.     }
  2412. }