MetaFox

FriendRequest extends Model
in package
implements Entity, IsNotifyInterface, HasUrl Uses HasEntity, HasOwnerMorph, HasUserMorph, HasFactory

Class FriendRequest.

Tags
mixin

Builder

Table of Contents

Interfaces

Entity
Interface Entity.
IsNotifyInterface
Interface Entity.
HasUrl

Constants

ACTION_APPROVE  = 'approve'
ACTION_DENY  = 'deny'
ENTITY_TYPE  = 'friend_request'
IS_DENY  = 1
IS_SEEN  = 1

Properties

$created_at  : string
$id  : int
$is_deny  : int
$is_ignore  : bool
$is_seen  : bool
$owner  : User
$status_id  : int
$updated_at  : string
$user  : User
$appends  : array<string|int, string>
$fillable  : mixed
$table  : mixed

Methods

entityId()  : int
entityType()  : string
factory()  : FriendRequestFactory
getIsIgnoreAttribute()  : bool
getIsSeenAttribute()  : bool
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.
moduleName()  : string
owner()  : MorphTo
ownerEntity()  : BelongsTo
ownerId()  : int
ownerType()  : string
toLink()  : string|null
toNotification()  : array<int, mixed>
creator result must contain User owner.
toRouter()  : string|null
toUrl()  : string|null
user()  : MorphTo
userEntity()  : BelongsTo
userId()  : int
userType()  : string
newFactory()  : FriendRequestFactory

Constants

Properties

$appends

protected array<string|int, string> $appends = ['is_seen', 'is_ignore']

$fillable

protected mixed $fillable = ['user_id', 'user_type', 'owner_type', 'owner_id', 'status_id', 'is_deny']

Methods

entityId()

public entityId() : int
Return values
int

entityType()

public entityType() : string
Return values
string

factory()

public static factory() : FriendRequestFactory
Return values
FriendRequestFactory

getIsIgnoreAttribute()

public getIsIgnoreAttribute() : bool
Return values
bool

getIsSeenAttribute()

public getIsSeenAttribute() : bool
Return values
bool

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

moduleName()

public moduleName() : string
Return values
string

ownerEntity()

public ownerEntity() : BelongsTo
Return values
BelongsTo

ownerType()

public ownerType() : string
Return values
string
public toLink() : string|null
Return values
string|null

toNotification()

creator result must contain User owner.

public toNotification() : array<int, mixed>
Return values
array<int, mixed>

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

newFactory()

protected static newFactory() : FriendRequestFactory
Return values
FriendRequestFactory

        
On this page

Search results