PHP 트레잇 Mpociot\Teamwork\Traits\UserHasTeams

파일 보기 프로젝트 열기: mpociot/teamwork

공개 메소드들

메소드 설명
attachTeam ( mixed $team, array $pivotData = [] ) Alias to eloquent many-to-many relation's attach() method.
attachTeams ( mixed $teams ) Attach multiple teams to a user
bootUserHasTeams ( ) : void | boolean Boot the user model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the user model uses soft deletes.
currentTeam ( ) : Illuminate\Database\Eloquent\Relations\HasOne has-one relation with the current selected team model.
detachTeam ( mixed $team ) Alias to eloquent many-to-many relation's detach() method.
detachTeams ( mixed $teams ) Detach multiple teams from a user
invites ( ) : mixed One-to-Many relation with the invite model
isOwner ( ) : boolean Returns if the user owns a team
isOwnerOfTeam ( mixed $team ) : boolean Returns if the user owns the given team
isTeamOwner ( ) : boolean Wrapper method for "isOwner"
ownedTeams ( ) : mixed
switchTeam ( object | array | integer $team ) Switch the current team of the user
teams ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Many-to-Many relations with the user model.

보호된 메소드들

메소드 설명
retrieveTeamId ( $team ) : mixed

메소드 상세

attachTeam() 공개 메소드

Alias to eloquent many-to-many relation's attach() method.
public attachTeam ( mixed $team, array $pivotData = [] )
$team mixed
$pivotData array

attachTeams() 공개 메소드

Attach multiple teams to a user
public attachTeams ( mixed $teams )
$teams mixed

bootUserHasTeams() 공개 정적인 메소드

Boot the user model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the user model uses soft deletes.
public static bootUserHasTeams ( ) : void | boolean
리턴 void | boolean

currentTeam() 공개 메소드

has-one relation with the current selected team model.
public currentTeam ( ) : Illuminate\Database\Eloquent\Relations\HasOne
리턴 Illuminate\Database\Eloquent\Relations\HasOne

detachTeam() 공개 메소드

Alias to eloquent many-to-many relation's detach() method.
public detachTeam ( mixed $team )
$team mixed

detachTeams() 공개 메소드

Detach multiple teams from a user
public detachTeams ( mixed $teams )
$teams mixed

invites() 공개 메소드

One-to-Many relation with the invite model
public invites ( ) : mixed
리턴 mixed

isOwner() 공개 메소드

Returns if the user owns a team
public isOwner ( ) : boolean
리턴 boolean

isOwnerOfTeam() 공개 메소드

Returns if the user owns the given team
public isOwnerOfTeam ( mixed $team ) : boolean
$team mixed
리턴 boolean

isTeamOwner() 공개 메소드

Wrapper method for "isOwner"
public isTeamOwner ( ) : boolean
리턴 boolean

ownedTeams() 공개 메소드

public ownedTeams ( ) : mixed
리턴 mixed

retrieveTeamId() 보호된 메소드

protected retrieveTeamId ( $team ) : mixed
$team
리턴 mixed

switchTeam() 공개 메소드

Switch the current team of the user
public switchTeam ( object | array | integer $team )
$team object | array | integer

teams() 공개 메소드

Many-to-Many relations with the user model.
public teams ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany