Comment
extends Model
in package
implements
ActionEntity, Content, HasApprove, HasTotalComment, HasTotalLike, HasItemMorph, HasTaggedFriend, HasHashTag, IsNotifyInterface
Uses
HasContent, HasOwnerMorph, HasUserMorph, HasItemMorph, HasFactory, HasTaggedFriendTrait
Class Comment.
Tags
Table of Contents
Interfaces
- ActionEntity
- Interface ActionEntity.
- Content
- Interface Content.
- HasApprove
- Interface HasApprove
- HasTotalComment
- Interface HasTotalComment.
- HasTotalLike
- Interface HasTotalLike.
- HasItemMorph
- HasTaggedFriend
- Interface HasTaggedFriend.
- HasHashTag
- Interface Entity.
- IsNotifyInterface
- Interface Entity.
Constants
- ENTITY_TYPE = 'comment'
Properties
- $children : Collection
- $commentAttachment : CommentAttachment|null
- $commentHides : Collection
- $created_at : string
- $id : int
- $is_edited : bool
- $is_hidden : bool
- $is_spam : bool
- $item : Content
- $item_id : int
- $item_type : string
- $owner : User
- $owner_id : int
- $owner_type : int
- $parent_id : int
- $parentComment : Comment
- $tagged_user_ids : mixed
- $text : string
- $text_parsed : string
- $total_tag_friend : int
- $updated_at : string
- $user : User
- $user_id : int
- $user_type : string
- $casts : array<string, mixed>
- $fillable : array<string|int, string>
- $isReview : int
Methods
- __toString() : mixed
- children() : HasMany
- commentAttachment() : HasOne
- commentHides() : HasMany
- commentHistory() : HasMany
- deletePrivacyStreams() : void
- Delete {item}_privacy_streams.
- disableFeedSponsor() : void
- disableSponsor() : void
- enableFeedSponsor() : void
- enableSponsor() : void
- factory() : CommentFactory
- getIsHiddenAttribute() : bool
- getItemAttribute() : mixed
- getOwnerAttribute() : mixed
- getOwnerEntityAttribute() : mixed
- getOwnerPendingMessage() : string|null
- This method is used for getting pending message if item is pending.
- getParentCommentAttribute() : mixed
- getThumbnail() : string|null
- getTotalPendingUserReplyAttribute() : int
- getTotalTagFriendAttribute() : int
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- hasTagStream() : bool
- incrementOrDecrement() : mixed
- isApproved() : mixed
- isDraft() : mixed
- isOwner() : bool
- check if $user is the owner of entity.
- isOwnerPending() : bool
- isPublished() : mixed
- isReview() : int
- isSponsored() : bool
- isSponsoredInFeed() : bool
- isUser() : bool
- check if $user is the user (creator) of entity.
- item() : MorphTo|null
- itemId() : int
- itemType() : string
- likes() : MorphMany
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- parentComment() : BelongsTo
- privacyItem() : self|null
- Get indicate item handle privacy logic.
- reactItem() : mixed
- replies() : HasMany
- Add this method to support Factories.
- setIsReview() : mixed
- shares() : MorphMany
- syncPrivacyStreams() : void
- Create {item}_privacy_streams.
- tagData() : BelongsToMany
- toApprovedNotification() : array<string|int, mixed>
- toCallbackMessage() : string
- toFullLink() : string|null
- toLink() : string|null
- toMail() : MailMessage
- toNotification() : array<string|int, mixed>|null
- creator result must contain User owner.
- toReportHeader() : string
- toReportTitle() : string
- toRouter() : string|null
- toSitemapUrl() : string|null
- toSponsorData() : array<string|int, mixed>|null
- toTagFriendLink() : string
- toTagFriendRouter() : string
- toTagFriendUrl() : string
- toTitle() : string
- toUrl() : string|null
- user() : MorphTo
- userEntity() : BelongsTo
- userHidden() : HasOne
- userId() : int
- userType() : string
- getOwnerNofitiables() : array<string|int, mixed>
- newFactory() : CommentFactory
- toCommentNotifiables() : array<string|int, mixed>
- toReplyNotifiables() : array<string|int, mixed>
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'comment'
Properties
$children
public
Collection
$children
$commentAttachment
public
CommentAttachment|null
$commentAttachment
$commentHides
public
Collection
$commentHides
$created_at
public
string
$created_at
$id
public
int
$id
$is_edited
public
bool
$is_edited
$is_hidden
public
bool
$is_hidden
$is_spam
public
bool
$is_spam
$item
public
Content
$item
$item_id
public
int
$item_id
$item_type
public
string
$item_type
$owner
public
User
$owner
$owner_id
public
int
$owner_id
- user id of content
$owner_type
public
int
$owner_type
$parent_id
public
int
$parent_id
$parentComment
public
Comment
$parentComment
$tagged_user_ids
public
mixed
$tagged_user_ids
$text
public
string
$text
$text_parsed
public
string
$text_parsed
$total_tag_friend
public
int
$total_tag_friend
$updated_at
public
string
$updated_at
$user
public
User
$user
$user_id
public
int
$user_id
$user_type
public
string
$user_type
$casts
protected
array<string, mixed>
$casts
= ['is_approved' => 'boolean', 'is_spam' => 'boolean', 'is_edited' => 'boolean', 'tagged_user_ids' => 'array']
$fillable
protected
array<string|int, string>
$fillable
= ['owner_id', 'owner_type', 'user_id', 'user_type', 'item_id', 'item_type', 'parent_id', 'is_approved', 'text', 'text_parsed', 'total_comment', 'total_pending_comment', 'total_like', 'is_edited', 'is_spam', 'tagged_user_ids']
$isReview
protected
int
$isReview
Methods
__toString()
public
__toString() : mixed
children()
public
children() : HasMany
Return values
HasManycommentAttachment()
public
commentAttachment() : HasOne
Return values
HasOnecommentHides()
public
commentHides() : HasMany
Return values
HasManycommentHistory()
public
commentHistory() : HasMany
Return values
HasManydeletePrivacyStreams()
Delete {item}_privacy_streams.
public
deletePrivacyStreams() : void
disableFeedSponsor()
public
disableFeedSponsor() : void
disableSponsor()
public
disableSponsor() : void
enableFeedSponsor()
public
enableFeedSponsor() : void
enableSponsor()
public
enableSponsor() : void
factory()
public
static factory(mixed $parameters) : CommentFactory
Parameters
- $parameters : mixed
Return values
CommentFactorygetIsHiddenAttribute()
public
getIsHiddenAttribute() : bool
Return values
boolgetItemAttribute()
public
getItemAttribute() : mixed
getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : mixed
getOwnerPendingMessage()
This method is used for getting pending message if item is pending.
public
getOwnerPendingMessage() : string|null
Return values
string|nullgetParentCommentAttribute()
public
getParentCommentAttribute() : mixed
getThumbnail()
public
getThumbnail() : string|null
Return values
string|nullgetTotalPendingUserReplyAttribute()
public
getTotalPendingUserReplyAttribute() : int
Return values
intgetTotalTagFriendAttribute()
public
getTotalTagFriendAttribute() : int
Return values
intgetUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
hasTagStream()
public
hasTagStream() : bool
Tags
Return values
boolincrementOrDecrement()
public
incrementOrDecrement(mixed $column, mixed $amount, mixed $extra, mixed $method) : mixed
Parameters
- $column : mixed
- $amount : mixed
- $extra : mixed
- $method : mixed
isApproved()
public
isApproved() : mixed
isDraft()
public
isDraft() : mixed
isOwner()
check if $user is the owner of entity.
public
isOwner(User $user) : bool
Parameters
- $user : User
Return values
boolisOwnerPending()
public
isOwnerPending() : bool
Return values
boolisPublished()
public
isPublished() : mixed
isReview()
public
isReview() : int
Return values
intisSponsored()
public
isSponsored() : bool
Return values
boolisSponsoredInFeed()
public
isSponsoredInFeed() : bool
Return values
boolisUser()
check if $user is the user (creator) of entity.
public
isUser(User $user) : bool
Parameters
- $user : User
Return values
boolitem()
public
item() : MorphTo|null
Return values
MorphTo|nullitemId()
public
itemId() : int
Return values
intitemType()
public
itemType() : string
Return values
stringlikes()
public
likes() : MorphMany
Return values
MorphManyowner()
public
owner() : MorphTo
Return values
MorphToownerEntity()
public
ownerEntity() : BelongsTo
Return values
BelongsToownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : string
Return values
stringparentComment()
public
parentComment() : BelongsTo
Return values
BelongsToprivacyItem()
Get indicate item handle privacy logic.
public
privacyItem() : self|null
Return values
self|nullreactItem()
public
reactItem() : mixed
replies()
Add this method to support Factories.
public
replies() : HasMany
Return values
HasManysetIsReview()
public
setIsReview(int $isReview) : mixed
Parameters
- $isReview : int
shares()
public
shares() : MorphMany
Return values
MorphManysyncPrivacyStreams()
Create {item}_privacy_streams.
public
syncPrivacyStreams(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
tagData()
public
tagData() : BelongsToMany
Return values
BelongsToManytoApprovedNotification()
public
toApprovedNotification() : array<string|int, mixed>
Return values
array<string|int, mixed>toCallbackMessage()
public
toCallbackMessage(UserEntity $user, UserEntity $owner[, bool $isMention = false ]) : string
Parameters
- $user : UserEntity
- $owner : UserEntity
- $isMention : bool = false
Return values
stringtoFullLink()
public
toFullLink() : string|null
Return values
string|nulltoLink()
public
toLink() : string|null
Return values
string|nulltoMail()
public
toMail(MailMessage $service, UserEntity|null $user, UserEntity|null $owner[, bool $isMention = false ]) : MailMessage
Parameters
- $service : MailMessage
- $user : UserEntity|null
- $owner : UserEntity|null
- $isMention : bool = false
Return values
MailMessagetoNotification()
creator result must contain User owner.
public
toNotification() : array<string|int, mixed>|null
notification class.
Return values
array<string|int, mixed>|nulltoReportHeader()
public
toReportHeader() : string
Return values
stringtoReportTitle()
public
toReportTitle() : string
Return values
stringtoRouter()
public
toRouter() : string|null
Return values
string|nulltoSitemapUrl()
public
toSitemapUrl() : string|null
Return values
string|nulltoSponsorData()
public
toSponsorData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulltoTagFriendLink()
public
toTagFriendLink() : string
Return values
stringtoTagFriendRouter()
public
toTagFriendRouter() : string
Return values
stringtoTagFriendUrl()
public
toTagFriendUrl() : string
Return values
stringtoTitle()
public
toTitle() : string
Return values
stringtoUrl()
public
toUrl() : string|null
Return values
string|nulluser()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserHidden()
public
userHidden() : HasOne
Return values
HasOneuserId()
public
userId() : int
Return values
intuserType()
public
userType() : string
Return values
stringgetOwnerNofitiables()
protected
getOwnerNofitiables(User $context) : array<string|int, mixed>
Parameters
- $context : User
Return values
array<string|int, mixed>newFactory()
protected
static newFactory() : CommentFactory
Return values
CommentFactorytoCommentNotifiables()
protected
toCommentNotifiables(User $context) : array<string|int, mixed>
Parameters
- $context : User
Return values
array<string|int, mixed>toReplyNotifiables()
protected
toReplyNotifiables(User $context) : array<string|int, mixed>
Parameters
- $context : User