MetaFox

Like extends Model
in package
implements ActionEntity, IsNotifyInterface, HasUrl Uses HasEntity, HasItemMorph, HasUserMorph, HasOwnerMorph, HasFactory

Class Like.

Tags
mixin

Builder

Table of Contents

Interfaces

ActionEntity
Interface ActionEntity.
IsNotifyInterface
Interface Entity.
HasUrl

Constants

ENTITY_TYPE  = 'like'

Properties

$created_at  : string
$item  : Content
$item_id  : int
$item_type  : string
$owner_id  : int
$owner_type  : string
$reaction  : Reaction
$reaction_id  : int
$updated_at  : string
$user  : User
$user_id  : int
$user_type  : string
$fillable  : mixed
$table  : mixed

Methods

entityId()  : int
entityType()  : string
factory()  : LikeFactory
getItemAttribute()  : mixed
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.
item()  : MorphTo|null
itemId()  : int
itemType()  : string
moduleName()  : string
owner()  : MorphTo
ownerEntity()  : BelongsTo
ownerId()  : int
ownerType()  : string
reaction()  : BelongsTo
toLink()  : string|null
toNotification()  : array<string|int, mixed>|null
creator result must contain User owner.
toRouter()  : string|null
toUrl()  : string|null
user()  : MorphTo
userEntity()  : BelongsTo
userId()  : int
userType()  : string
getOwnerNofitiables()  : array<string|int, mixed>
newFactory()  : LikeFactory

Constants

ENTITY_TYPE

public mixed ENTITY_TYPE = 'like'

Properties

$created_at

public string $created_at

$item_id

public int $item_id

$item_type

public string $item_type

$owner_id

public int $owner_id
  • user id of content.

$owner_type

public string $owner_type

$reaction_id

public int $reaction_id

$updated_at

public string $updated_at

$user_id

public int $user_id

$user_type

public string $user_type

$fillable

protected mixed $fillable = ['item_id', 'item_type', 'user_id', 'user_type', 'owner_id', 'owner_type', 'reaction_id']

$table

protected mixed $table = 'likes'

Methods

entityId()

public entityId() : int
Return values
int

entityType()

public entityType() : string
Return values
string

factory()

public static factory(mixed $parameters) : LikeFactory
Parameters
$parameters : mixed
Return values
LikeFactory

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

item()

public item() : MorphTo|null
Return values
MorphTo|null

itemType()

public itemType() : string
Return values
string

moduleName()

public moduleName() : string
Return values
string

ownerEntity()

public ownerEntity() : BelongsTo
Return values
BelongsTo

ownerType()

public ownerType() : string
Return values
string

reaction()

public reaction() : BelongsTo
Return values
BelongsTo
public toLink() : string|null
Return values
string|null

toNotification()

creator result must contain User owner.

public toNotification() : array<string|int, mixed>|null
Tags
throws
AuthenticationException
Return values
array<string|int, mixed>|null

toRouter()

public toRouter() : string|null
Return values
string|null

toUrl()

public toUrl() : string|null
Return values
string|null

userEntity()

public userEntity() : BelongsTo
Return values
BelongsTo

userType()

public userType() : string
Return values
string

getOwnerNofitiables()

protected getOwnerNofitiables(User $context) : array<string|int, mixed>
Parameters
$context : User
Return values
array<string|int, mixed>

newFactory()

protected static newFactory() : LikeFactory
Return values
LikeFactory

        
On this page

Search results