MetaFox

Friend extends Model
in package
implements Membership, IsActivitySubscriptionInterface, IsPrivacyItemInterface, ActivityFeedSource, HasUrl Uses HasEntity, HasFeed, HasUserMorph, HasOwnerMorph, HasFactory

Class Friend.

Tags
mixin

Builder

Table of Contents

Interfaces

Membership
Interface Entity.
IsActivitySubscriptionInterface
IsPrivacyItemInterface
ActivityFeedSource
Interface ActivityFeedSource.
HasUrl

Constants

ENTITY_TYPE  = 'friend'
PRIVACY_FRIENDS  = 'user_friends'

Properties

$id  : int
$owner  : User
$owner_id  : int
$owner_type  : int
$user_id  : int
$user_type  : string
$fillable  : mixed

Methods

activity_feed()  : MorphOne|null
Morph Relation.
entityId()  : int
entityType()  : string
factory()  : FriendFactory
getActivityFeedAttribute()  : 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.
moduleName()  : string
owner()  : MorphTo
ownerEntity()  : BelongsTo
ownerId()  : int
ownerType()  : string
privacy()  : int|null
privacyUserId()  : int|null
shouldSubscribe()  : bool
toActivityFeed()  : FeedAction|null
toActivitySubscription()  : array<string|int, int>
This method must return [$userId, $ownerId] $userId: who subscribe $ownerId: whom subscribe from When $owner post content on profile, $userId can see $owner feed.
toLink()  : string|null
toPrivacyItem()  : array<string|int, mixed>
Result [ [$userId, $itemId, $itemType, $privacyType] ] $userId: to Insert into privacy_data $itemId: $itemType, $privacyType: to find privacy_id.
toRouter()  : string|null
toUrl()  : string|null
user()  : MorphTo
userEntity()  : BelongsTo
userId()  : int
userType()  : string
newFactory()  : FriendFactory

Constants

ENTITY_TYPE

public mixed ENTITY_TYPE = 'friend'

PRIVACY_FRIENDS

public mixed PRIVACY_FRIENDS = 'user_friends'

Properties

$owner_type

public int $owner_type

$user_type

public string $user_type

$fillable

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

Methods

activity_feed()

Morph Relation.

public activity_feed() : MorphOne|null
Tags
SuppressWarnings

(PHPMD.CamelCaseMethodName)

Return values
MorphOne|null

entityId()

public entityId() : int
Return values
int

entityType()

public entityType() : string
Return values
string

factory()

public static factory() : FriendFactory
Return values
FriendFactory

getActivityFeedAttribute()

public getActivityFeedAttribute() : mixed

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

privacy()

public privacy() : int|null
Return values
int|null

privacyUserId()

public privacyUserId() : int|null
Return values
int|null

shouldSubscribe()

public shouldSubscribe() : bool
Return values
bool

toActivitySubscription()

This method must return [$userId, $ownerId] $userId: who subscribe $ownerId: whom subscribe from When $owner post content on profile, $userId can see $owner feed.

public toActivitySubscription() : array<string|int, int>
Return values
array<string|int, int>
public toLink() : string|null
Return values
string|null

toPrivacyItem()

Result [ [$userId, $itemId, $itemType, $privacyType] ] $userId: to Insert into privacy_data $itemId: $itemType, $privacyType: to find privacy_id.

public toPrivacyItem() : array<string|int, mixed>
Return values
array<string|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() : FriendFactory
Return values
FriendFactory

        
On this page

Search results