UserPrivacy
in package
implements
PrivacyForSettingInterface
Class UserPrivacy.
Tags
Table of Contents
Interfaces
- PrivacyForSettingInterface
- Interface PrivacyForSettingInterface.
Constants
- CACHE_LIFETIME = 3000
- CACHE_NAME_USER_PRIVACY = 'user_privacy'
- CACHE_NAME_USER_PRIVACY_TYPES = 'user_privacy_types'
Properties
- $menuItemRepository : MenuItemRepositoryInterface
- $repository : UserPrivacyRepositoryInterface
Methods
- __construct() : mixed
- getDefaultPrivacy() : int
- getItemPrivacySetting() : false|mixed
- getPrivacyOptionsPhrase() : array<int, string>
- getProfileMenuSetting() : false|mixed
- getProfileSetting() : int|false
- getUserPrivacy() : array<string, mixed>
- hasAccess() : bool
- Check has accessibility of an user on owner privacy.
- hasAccessProfileMenuSettings() : array<string, mixed>
- hasAccessProfileSettings() : array<string, mixed>
- validateItemPrivacySettings() : bool
- validateProfileMenuSettings() : bool
- validateProfileSettings() : bool
- getMenuItemOfUserByMenu() : Collection
- handleProfileMenuMobile() : array<string|int, mixed>
- checkPrivacy() : mixed
- getHasAccessForSettings() : array<string, mixed>
- getPrivacyTypesByEntity() : array<string, mixed>
- Get privacy types fromm all apps with value stored in database.
- hasPrivacyMember() : bool
- hasPrivacyOnlyMe() : bool
- isFriendOfFriend() : bool
- validateUserSettings() : void
Constants
CACHE_LIFETIME
public
mixed
CACHE_LIFETIME
= 3000
CACHE_NAME_USER_PRIVACY
public
mixed
CACHE_NAME_USER_PRIVACY
= 'user_privacy'
CACHE_NAME_USER_PRIVACY_TYPES
public
mixed
CACHE_NAME_USER_PRIVACY_TYPES
= 'user_privacy_types'
Properties
$menuItemRepository
protected
MenuItemRepositoryInterface
$menuItemRepository
$repository
protected
UserPrivacyRepositoryInterface
$repository
Methods
__construct()
public
__construct(UserPrivacyRepositoryInterface $repository, MenuItemRepositoryInterface $menuItemRepository) : mixed
Parameters
- $repository : UserPrivacyRepositoryInterface
- $menuItemRepository : MenuItemRepositoryInterface
getDefaultPrivacy()
public
getDefaultPrivacy() : int
Return values
intgetItemPrivacySetting()
public
getItemPrivacySetting(int $userId, string $privacyName) : false|mixed
Parameters
- $userId : int
- $privacyName : string
Return values
false|mixedgetPrivacyOptionsPhrase()
public
getPrivacyOptionsPhrase() : array<int, string>
Return values
array<int, string>getProfileMenuSetting()
public
getProfileMenuSetting(int $userId, string $privacyName) : false|mixed
Parameters
- $userId : int
- $privacyName : string
Return values
false|mixedgetProfileSetting()
public
getProfileSetting(int $userId, string $privacyName) : int|false
Parameters
- $userId : int
- $privacyName : string
Return values
int|falsegetUserPrivacy()
public
getUserPrivacy(int $userId) : array<string, mixed>
Parameters
- $userId : int
Return values
array<string, mixed>hasAccess()
Check has accessibility of an user on owner privacy.
public
hasAccess(User $user, User $owner, string $privacySettingName) : bool
Do not check isBlocked in here, use: PrivacyPolicy::checkPermissionOwner($user, $owner) before this method.
Parameters
Tags
Return values
boolhasAccessProfileMenuSettings()
public
hasAccessProfileMenuSettings(User $user, User $owner) : array<string, mixed>
Parameters
Return values
array<string, mixed>hasAccessProfileSettings()
public
hasAccessProfileSettings(User $user, User $owner) : array<string, mixed>
Parameters
Return values
array<string, mixed>validateItemPrivacySettings()
public
validateItemPrivacySettings(int $userId, array<string, int> $params) : bool
Parameters
- $userId : int
- $params : array<string, int>
Tags
Return values
boolvalidateProfileMenuSettings()
public
validateProfileMenuSettings(int $userId, array<string, int> $params) : bool
Parameters
- $userId : int
- $params : array<string, int>
Tags
Return values
boolvalidateProfileSettings()
public
validateProfileSettings(int $userId, array<string, int> $params) : bool
Parameters
- $userId : int
- $params : array<string, int>
Tags
Return values
boolgetMenuItemOfUserByMenu()
protected
getMenuItemOfUserByMenu() : Collection
Return values
CollectionhandleProfileMenuMobile()
protected
handleProfileMenuMobile(array<string|int, mixed> $menuSettings, array<string|int, mixed> $menu) : array<string|int, mixed>
Parameters
- $menuSettings : array<string|int, mixed>
- $menu : array<string|int, mixed>
Return values
array<string|int, mixed>checkPrivacy()
private
checkPrivacy(User $user, User $owner, int $privacy, int $privacyId) : mixed
Parameters
getHasAccessForSettings()
private
getHasAccessForSettings(array<string, mixed> $settings, User $user, User $owner) : array<string, mixed>
Parameters
Tags
Return values
array<string, mixed>getPrivacyTypesByEntity()
Get privacy types fromm all apps with value stored in database.
private
getPrivacyTypesByEntity(string $entityType) : array<string, mixed>
Parameters
- $entityType : string
Return values
array<string, mixed>hasPrivacyMember()
private
hasPrivacyMember(int $userId, int $privacyId) : bool
Parameters
- $userId : int
- $privacyId : int
Return values
boolhasPrivacyOnlyMe()
private
hasPrivacyOnlyMe(User $user, User $owner) : bool
Parameters
Return values
boolisFriendOfFriend()
private
isFriendOfFriend(int $userId, int $ownerId, int $privacyId) : bool
Parameters
- $userId : int
- $ownerId : int
- $privacyId : int
Tags
Return values
boolvalidateUserSettings()
private
validateUserSettings(array<string, mixed> $allows, array<string, mixed> $params, string $message) : void
Parameters
- $allows : array<string, mixed>
- $params : array<string, mixed>
- $message : string