Skip to content

InteractionUtility

App\Utilities\InteractionUtility

Check if Liked

php
InteractionUtility::checkUserLike($likeType, $likeId, $userId);
Parameter NameTypeRequiredDescription
likeTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
likeIdNumberrequiredPrimary id of the corresponding type
userIdNumberrequiredusers->id
  • Check if user userId has liked the likeType object with likeId.

Check if Disliked

php
InteractionUtility::checkUserDislike($dislikeType, $dislikeId, $userId);
Parameter NameTypeRequiredDescription
dislikeTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
dislikeIdNumberrequiredPrimary id of the corresponding type
userIdNumberrequiredusers->id
  • Check if user userId has disliked the dislikeType object with dislikeId.

Check if Followed

php
InteractionUtility::checkUserFollow($followType, $followId, $userId);
Parameter NameTypeRequiredDescription
followTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
followIdNumberrequiredPrimary id of the corresponding type
userIdNumberrequiredusers->id
  • Check if user userId has followed the followType object with followId.

Check if Blocked

php
InteractionUtility::checkUserBlock($blockType, $blockId, $userId);
Parameter NameTypeRequiredDescription
blockTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
blockIdNumberrequiredPrimary id of the corresponding type
userIdNumberrequiredusers->id
  • Check if user userId has blocked the blockType object with blockId.

Check All Statuses

php
InteractionUtility::checkInteractionStatus($markType, $markId, $userId);
Parameter NameTypeRequiredDescription
markTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
markIdNumberrequiredPrimary id of the corresponding type
userIdNumberrequiredusers->id
  • Check if user userId has mark the markType object with markId.
  • Output whether to like, dislike, follow and block.
  • Parameter Name likeStatus,dislikeStatus,followStatus,blockStatus

Mark Like Action

php
InteractionUtility::markUserLike($userId, $likeType, $likeId);

Mark Dislike Action

php
InteractionUtility::markUserDislike($userId, $dislikeType, $dislikeId);

Mark Follow Action

php
InteractionUtility::markUserFollow($userId, $followType, $followId);

Mark Block Action

php
InteractionUtility::markUserBlock($userId, $blockType, $blockId);

Mark Content Sticky

php
InteractionUtility::markContentSticky($type, $id, $stickyState);
Parameter NameTypeRequiredDescription
typeNumberrequiredpost or comment
idNumberrequiredPrimary id of the corresponding type
stickyStateNumberrequiredPost: 1.No / 2.Group State / 3.Global Sticky
Comment: 0.No / 1.Yes

Mark Content Digest

php
InteractionUtility::markContentDigest($type, $id, $digestState);
Parameter NameTypeRequiredDescription
typeNumberrequiredpost or comment
idNumberrequiredPrimary id of the corresponding type
digestStateNumberrequired1.No / 2.General Digest / 3.Premium Digest

Mark Behavior Statistics Count

php
InteractionUtility::markStats($userId, $interactionType, $markType, $markId, $actionType);
Parameter NameTypeRequiredDescription
userIdNumberrequiredusers->id
interactionTypeStringrequiredlike, dislike, follow, block
markTypeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
markIdNumberrequiredPrimary id of the corresponding type
actionTypeStringrequiredincrement or decrement

Publish Behavior Statistics Count

php
InteractionUtility::publishStats($type, $id, $actionType);
Parameter NameTypeRequiredDescription
typeNumberrequiredpost or comment
idNumberrequiredPrimary id of the corresponding type
actionTypeStringrequiredincrement or decrement

Digest Behavior Statistics Count

php
InteractionUtility::digestStats($type, $id, $actionType);
Parameter NameTypeRequiredDescription
typeNumberrequiredpost or comment
idNumberrequiredPrimary id of the corresponding type
actionTypeStringrequiredincrement or decrement

Get Followed Object ID Array

php
InteractionUtility::getFollowIdArr($type, $userId);
Parameter NameTypeRequiredDescription
typeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
userIdNumberrequiredusers->id

Get Blocked Object ID Array

php
InteractionUtility::getBlockIdArr($type, $userId);
Parameter NameTypeRequiredDescription
typeNumberrequired1.User / 2.Group / 3.Hashtag / 4.Post / 5.Comment
userIdNumberrequiredusers->id

Get Private Group ID Array

php
InteractionUtility::getPrivateGroupIdArr();

Released under the Apache-2.0 License