PHP Класс BookStack\Repos\UserRepo

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

Защищенные свойства (Protected)

Свойство Тип Описание
$entityRepo
$role
$user

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

Метод Описание
__construct ( User $user, Role $role, EntityRepo $entityRepo ) UserRepo constructor.
attachDefaultRole ( $user ) Give a user the default role. Used when creating a new user.
create ( array $data ) : User Create a new basic instance of user.
destroy ( User $user ) Remove the given user from storage, Delete all related content.
getActivity ( User $user, integer $count = 20, integer $page ) : array Get the latest activity for a user.
getAllRoles ( ) : mixed Get the roles in the system that are assignable to a user.
getAllUsers ( ) : Builder | static Get all the users with their permissions.
getAllUsersPaginatedAndSorted ( integer $count = 20, $sortData ) : Builder | static Get all the users with their permissions in a paginated format.
getAssetCounts ( User $user ) : array Get asset created counts for the give user.
getByEmail ( string $email ) : User | null
getById ( integer $id ) : User
getRecentlyCreated ( User $user, integer $count = 20 ) : mixed Get the recently created content for this given user.
getRestrictableRoles ( ) : mixed Get all the roles which can be given restricted access to other entities in the system.
isOnlyAdmin ( User $user ) : boolean Checks if the give user is the only admin.
registerNew ( array $data ) : User Creates a new user and attaches a role to them.

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

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

UserRepo constructor.
public __construct ( User $user, Role $role, EntityRepo $entityRepo )
$user BookStack\User
$role BookStack\Role
$entityRepo EntityRepo

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

Give a user the default role. Used when creating a new user.
public attachDefaultRole ( $user )
$user

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

Create a new basic instance of user.
public create ( array $data ) : User
$data array
Результат BookStack\User

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

Remove the given user from storage, Delete all related content.
public destroy ( User $user )
$user BookStack\User

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

Get the latest activity for a user.
public getActivity ( User $user, integer $count = 20, integer $page ) : array
$user BookStack\User
$count integer
$page integer
Результат array

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

Get the roles in the system that are assignable to a user.
public getAllRoles ( ) : mixed
Результат mixed

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

Get all the users with their permissions.
public getAllUsers ( ) : Builder | static
Результат Illuminate\Database\Eloquent\Builder | static

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

Get all the users with their permissions in a paginated format.
public getAllUsersPaginatedAndSorted ( integer $count = 20, $sortData ) : Builder | static
$count integer
$sortData
Результат Illuminate\Database\Eloquent\Builder | static

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

Get asset created counts for the give user.
public getAssetCounts ( User $user ) : array
$user BookStack\User
Результат array

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

public getByEmail ( string $email ) : User | null
$email string
Результат BookStack\User | null

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

public getById ( integer $id ) : User
$id integer
Результат BookStack\User

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

Get the recently created content for this given user.
public getRecentlyCreated ( User $user, integer $count = 20 ) : mixed
$user BookStack\User
$count integer
Результат mixed

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

Get all the roles which can be given restricted access to other entities in the system.
public getRestrictableRoles ( ) : mixed
Результат mixed

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

Checks if the give user is the only admin.
public isOnlyAdmin ( User $user ) : boolean
$user BookStack\User
Результат boolean

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

Creates a new user and attaches a role to them.
public registerNew ( array $data ) : User
$data array
Результат BookStack\User

Описание свойств

$entityRepo защищенное свойство

protected $entityRepo

$role защищенное свойство

protected $role

$user защищенное свойство

protected $user