PHP Трейт Mpociot\Teamwork\Traits\UserHasTeams

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

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

Метод Описание
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