CommentPolicy
in package
implements
ActionOnResourcePolicyInterface
Uses
HasPolicyTrait, CheckModeratorSettingTrait
Class CommentPolicy.
Table of Contents
Interfaces
- ActionOnResourcePolicyInterface
- Interface ActionOnResourcePolicyInterface.
Properties
- $type : string
Methods
- __call() : bool
- addAttachment() : bool
- checkModeratorSetting() : bool
- commentItem() : bool
- create() : bool
- delete() : bool
- deleteOwn() : bool
- download() : bool
- getEntityType() : string
- hide() : bool
- hideGlobal() : bool
- removeLinkPreview() : bool
- share() : bool
- update() : bool
- updateAttachment() : bool
- updateOwnItem() : bool
- view() : bool
- viewAny() : bool
- viewApprove() : void
- viewHistory() : bool
- viewOnProfilePage() : bool
- viewOwner() : bool
- checkPermissionOnItem() : bool
Properties
$type
protected
string
$type
= \MetaFox\Comment\Models\Comment::ENTITY_TYPE
Methods
__call()
public
__call(string $ability, array<string|int, mixed> $arguments) : bool
Parameters
- $ability : string
- $arguments : array<string|int, mixed>
Return values
booladdAttachment()
public
addAttachment(User $user, array<string|int, mixed> $attributes) : bool
Parameters
- $user : User
- $attributes : array<string|int, mixed>
Return values
boolcheckModeratorSetting()
public
checkModeratorSetting(User $user, User $owner, string $settingName) : bool
Parameters
Return values
boolcommentItem()
public
commentItem(string $entityType, User $user, mixed $resource[, mixed $newValue = null ]) : bool
Parameters
- $entityType : string
- $user : User
- $resource : mixed
- $newValue : mixed = null
Return values
boolcreate()
public
create(User $user[, Content|null $resource = null ]) : bool
Parameters
Return values
booldelete()
public
delete(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
booldeleteOwn()
public
deleteOwn(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
booldownload()
public
download(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
boolgetEntityType()
public
getEntityType() : string
Return values
stringhide()
public
hide(User $context[, Content|null $resource = null ]) : bool
Parameters
Return values
boolhideGlobal()
public
hideGlobal(User $context[, Content|null $resource = null ]) : bool
Parameters
Return values
boolremoveLinkPreview()
public
removeLinkPreview(User $user, Entity $resource) : bool
Parameters
Return values
boolshare()
public
share(User $user[, Content|null $resource = null ]) : bool
Parameters
Tags
Return values
boolupdate()
public
update(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
boolupdateAttachment()
public
updateAttachment(User $user, Entity|null $resource, array<string|int, mixed> $attributes) : bool
Parameters
Return values
boolupdateOwnItem()
public
updateOwnItem(User $user[, Entity|null $resource = null ]) : bool
Parameters
Return values
boolview()
public
view(User $user, Entity $resource) : bool
Parameters
Return values
boolviewAny()
public
viewAny(User $user[, User|null $owner = null ]) : bool
Parameters
Return values
boolviewApprove()
public
viewApprove(User $user, Content|null $resource = null) : void
Parameters
viewHistory()
public
viewHistory(User $user[, Content|null $resource = null ]) : bool
Parameters
Return values
boolviewOnProfilePage()
public
viewOnProfilePage(User $user, User $owner) : bool
Parameters
Return values
boolviewOwner()
public
viewOwner(User $user[, User|null $owner = null ]) : bool
Parameters
Return values
boolcheckPermissionOnItem()
protected
checkPermissionOnItem(User $user, Content $resource) : bool