MetaFox

Attachment extends Model
in package
Uses HasEntity, HasFactory, HasUserMorph, HasOwnerMorph

Class Attachment.

Tags
mixin

Builder

Table of Contents

Constants

ENTITY_TYPE  = 'attachment'

Properties

$content  : string
$id  : int
$items  : Collection|array<string|int, AttachmentData>
$owner_id  : int
$owner_type  : string
$privacy  : int
$total_comment  : int
$total_item  : int
$total_like  : int
$total_share  : int
$user_id  : int
$user_type  : string
$fillable  : array<string|int, string>
$table  : mixed

Methods

entityId()  : int
entityType()  : string
factory()  : AttachmentFactory
getOwnerAttribute()  : mixed
getOwnerEntityAttribute()  : mixed
getUserAttribute()  : mixed
getUserEntityAttribute()  : mixed
isOwner()  : bool
check if $user is the owner of entity.
isUser()  : bool
check if $user is the user (creator) of entity.
items()  : HasMany
moduleName()  : string
owner()  : MorphTo
ownerEntity()  : BelongsTo
ownerId()  : int
ownerType()  : string
user()  : MorphTo
userEntity()  : BelongsTo
userId()  : int
userType()  : string

Constants

ENTITY_TYPE

public mixed ENTITY_TYPE = 'attachment'

Properties

$fillable

protected array<string|int, string> $fillable = ['user_id', 'user_type', 'owner_id', 'owner_type', 'privacy', 'total_like', 'total_comment', 'total_share', 'total_item', 'content']

$table

protected mixed $table = 'activity_attachments'

Methods

entityId()

public entityId() : int
Return values
int

entityType()

public entityType() : string
Return values
string

factory()

public static factory([array<string, mixed> $parameters = [] ]) : AttachmentFactory
Parameters
$parameters : array<string, mixed> = []
Return values
AttachmentFactory

getOwnerEntityAttribute()

public getOwnerEntityAttribute() : mixed

getUserEntityAttribute()

public getUserEntityAttribute() : mixed

isOwner()

check if $user is the owner of entity.

public isOwner(User $user) : bool
Parameters
$user : User
Return values
bool

isUser()

check if $user is the user (creator) of entity.

public isUser(User $user) : bool
Parameters
$user : User
Return values
bool

items()

public items() : HasMany
Return values
HasMany

moduleName()

public moduleName() : string
Return values
string

ownerEntity()

public ownerEntity() : BelongsTo
Return values
BelongsTo

ownerType()

public ownerType() : string
Return values
string

userEntity()

public userEntity() : BelongsTo
Return values
BelongsTo

userType()

public userType() : string
Return values
string

        
On this page

Search results