PHP Трейт Hootlex\Friendships\Traits\Friendable

Показать файл Открыть проект

Открытые методы

Метод Описание
acceptFriendRequest ( Model $recipient ) : boolean | integer
befriend ( Model $recipient ) : Friendship | false
blockFriend ( Model $recipient ) : Friendship
canBefriend ( Model $recipient ) : boolean
denyFriendRequest ( Model $recipient ) : boolean | integer
friends ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
getAcceptedFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
getAllFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
getBlockedFriendships ( ) : Illuminate\Database\Eloquent\Collection
getDeniedFriendships ( ) : Illuminate\Database\Eloquent\Collection
getFriendRequests ( ) : Illuminate\Database\Eloquent\Collection
getFriends ( integer $perPage, string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection This method will not return Friendship models It will return the 'friends' models. ex: App\User
getFriendsCount ( string $groupSlug = '' ) : integer Get the number of friends
getFriendsOfFriends ( integer $perPage ) : Illuminate\Database\Eloquent\Collection This method will not return Friendship models It will return the 'friends' models. ex: App\User
getFriendship ( Model $recipient ) : Friendship
getMutualFriends ( Model $other, integer $perPage ) : Illuminate\Database\Eloquent\Collection This method will not return Friendship models It will return the 'friends' models. ex: App\User
getMutualFriendsCount ( $other ) : integer Get the number of friends
getPendingFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
groupFriend ( Model $friend, $groupSlug ) : boolean
groups ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
hasBlocked ( Model $recipient ) : boolean
hasFriendRequestFrom ( Model $recipient ) : boolean
hasSentFriendRequestTo ( Model $recipient ) : boolean
isBlockedBy ( Model $recipient ) : boolean
isFriendWith ( Model $recipient ) : boolean
unblockFriend ( Model $recipient ) : mixed
unfriend ( Model $recipient ) : boolean
ungroupFriend ( Model $friend, $groupSlug = '' ) : boolean

Защищенные методы

Метод Описание
getOrPaginate ( $builder, $perPage )

Приватные методы

Метод Описание
findFriendship ( Model $recipient ) : Builder
findFriendships ( $status = null, string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
friendsOfFriendsQueryBuilder ( string $groupSlug = '' ) : Builder Get the query builder for friendsOfFriends ('friend' model)
getFriendsQueryBuilder ( string $groupSlug = '' ) : Builder Get the query builder of the 'friend' model
getMutualFriendsQueryBuilder ( Model $other ) : Builder Get the query builder of the 'friend' model

Описание методов

acceptFriendRequest() публичный Метод

public acceptFriendRequest ( Model $recipient ) : boolean | integer
$recipient Illuminate\Database\Eloquent\Model
Результат boolean | integer

befriend() публичный Метод

public befriend ( Model $recipient ) : Friendship | false
$recipient Illuminate\Database\Eloquent\Model
Результат Hootlex\Friendships\Models\Friendship | false

blockFriend() публичный Метод

public blockFriend ( Model $recipient ) : Friendship
$recipient Illuminate\Database\Eloquent\Model
Результат Hootlex\Friendships\Models\Friendship

canBefriend() публичный Метод

public canBefriend ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

denyFriendRequest() публичный Метод

public denyFriendRequest ( Model $recipient ) : boolean | integer
$recipient Illuminate\Database\Eloquent\Model
Результат boolean | integer

friends() публичный Метод

public friends ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
Результат Illuminate\Database\Eloquent\Relations\MorphMany

getAcceptedFriendships() публичный Метод

public getAcceptedFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
$groupSlug string
Результат Illuminate\Database\Eloquent\Collection

getAllFriendships() публичный Метод

public getAllFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
$groupSlug string
Результат Illuminate\Database\Eloquent\Collection

getBlockedFriendships() публичный Метод

public getBlockedFriendships ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

getDeniedFriendships() публичный Метод

public getDeniedFriendships ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

getFriendRequests() публичный Метод

public getFriendRequests ( ) : Illuminate\Database\Eloquent\Collection
Результат Illuminate\Database\Eloquent\Collection

getFriends() публичный Метод

This method will not return Friendship models It will return the 'friends' models. ex: App\User
public getFriends ( integer $perPage, string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
$perPage integer Number
$groupSlug string
Результат Illuminate\Database\Eloquent\Collection

getFriendsCount() публичный Метод

Get the number of friends
public getFriendsCount ( string $groupSlug = '' ) : integer
$groupSlug string
Результат integer

getFriendsOfFriends() публичный Метод

This method will not return Friendship models It will return the 'friends' models. ex: App\User
public getFriendsOfFriends ( integer $perPage ) : Illuminate\Database\Eloquent\Collection
$perPage integer Number
Результат Illuminate\Database\Eloquent\Collection

getFriendship() публичный Метод

public getFriendship ( Model $recipient ) : Friendship
$recipient Illuminate\Database\Eloquent\Model
Результат Hootlex\Friendships\Models\Friendship

getMutualFriends() публичный Метод

This method will not return Friendship models It will return the 'friends' models. ex: App\User
public getMutualFriends ( Model $other, integer $perPage ) : Illuminate\Database\Eloquent\Collection
$other Illuminate\Database\Eloquent\Model
$perPage integer Number
Результат Illuminate\Database\Eloquent\Collection

getMutualFriendsCount() публичный Метод

Get the number of friends
public getMutualFriendsCount ( $other ) : integer
Результат integer

getOrPaginate() защищенный Метод

protected getOrPaginate ( $builder, $perPage )

getPendingFriendships() публичный Метод

public getPendingFriendships ( string $groupSlug = '' ) : Illuminate\Database\Eloquent\Collection
$groupSlug string
Результат Illuminate\Database\Eloquent\Collection

groupFriend() публичный Метод

public groupFriend ( Model $friend, $groupSlug ) : boolean
$friend Illuminate\Database\Eloquent\Model
$groupSlug
Результат boolean

groups() публичный Метод

public groups ( ) : Illuminate\Database\Eloquent\Relations\MorphMany
Результат Illuminate\Database\Eloquent\Relations\MorphMany

hasBlocked() публичный Метод

public hasBlocked ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

hasFriendRequestFrom() публичный Метод

public hasFriendRequestFrom ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

hasSentFriendRequestTo() публичный Метод

public hasSentFriendRequestTo ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

isBlockedBy() публичный Метод

public isBlockedBy ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

isFriendWith() публичный Метод

public isFriendWith ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

unblockFriend() публичный Метод

public unblockFriend ( Model $recipient ) : mixed
$recipient Illuminate\Database\Eloquent\Model
Результат mixed

unfriend() публичный Метод

public unfriend ( Model $recipient ) : boolean
$recipient Illuminate\Database\Eloquent\Model
Результат boolean

ungroupFriend() публичный Метод

public ungroupFriend ( Model $friend, $groupSlug = '' ) : boolean
$friend Illuminate\Database\Eloquent\Model
$groupSlug
Результат boolean