Like
extends Model
in package
implements
ActionEntity, IsNotifyInterface, HasUrl
Uses
HasEntity, HasItemMorph, HasUserMorph, HasOwnerMorph, HasFactory
Class Like.
Tags
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
public
Content
$item
$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
public
Reaction
$reaction
$reaction_id
public
int
$reaction_id
$updated_at
public
string
$updated_at
$user
public
User
$user
$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
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : LikeFactory
Parameters
- $parameters : mixed
Return values
LikeFactorygetItemAttribute()
public
getItemAttribute() : mixed
getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : mixed
getUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
isOwner()
check if $user is the owner of entity.
public
isOwner(User $user) : bool
Parameters
- $user : User
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
stringmoduleName()
public
moduleName() : string
Return values
stringowner()
public
owner() : MorphTo
Return values
MorphToownerEntity()
public
ownerEntity() : BelongsTo
Return values
BelongsToownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : string
Return values
stringreaction()
public
reaction() : BelongsTo
Return values
BelongsTotoLink()
public
toLink() : string|null
Return values
string|nulltoNotification()
creator result must contain User owner.
public
toNotification() : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>|nulltoRouter()
public
toRouter() : string|null
Return values
string|nulltoUrl()
public
toUrl() : string|null
Return values
string|nulluser()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserId()
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() : LikeFactory