PHP 트레잇 Hootlex\Friendships\Traits\Friendable

파일 보기 프로젝트 열기: hootlex/laravel-friendships

공개 메소드들

메소드 설명
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