PHP Class Learner\Repositories\Eloquent\UserRepository

Inheritance: extends AbstractRepository, implements Learner\Repositories\UserRepositoryInterface
Afficher le fichier Open project: RryLee/learner.video

Protected Properties

Свойство Type Description
$relations array The user relate models.

Méthodes publiques

Méthode Description
__construct ( User $user ) Create a new User instance.
attachRole ( User $user, mixed $roleOrRoleId ) attach a role to user.
attachRoleById ( integer $userId, array $roleIds ) : User Give user one or more roles.
create ( array $data ) : User Create a new user in the database.
delete ( integer $id ) Delete user from database and remove avatar.
findAllActivePaginated ( integer $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[] Find all active users paginated.
findNotActivePaginated ( integer $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[] Find all not active users paginated.
findTrashedPaginated ( $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[] Find all users in trash paginated.
findWithTrashedById ( integer $id ) : User Find user by id with trashed.
getRegisterForm ( ) : Learner\Services\Forms\UserRegisterFormService. Get the user creation form service.
remove ( integer $id ) Remove the user to trash.
restore ( integer $id ) Restore a user from trash.
toggleActive ( integer $id ) : boolean Change user's status.
update ( integer $id, array $attributes ) Update user.

Method Details

__construct() public méthode

Create a new User instance.
public __construct ( User $user )
$user Learner\Models\User

attachRole() public méthode

attach a role to user.
public attachRole ( User $user, mixed $roleOrRoleId )
$user Learner\Models\User
$roleOrRoleId mixed

attachRoleById() public méthode

Give user one or more roles.
public attachRoleById ( integer $userId, array $roleIds ) : User
$userId integer
$roleIds array
Résultat Learner\Models\User

create() public méthode

Create a new user in the database.
public create ( array $data ) : User
$data array
Résultat Learner\Models\User

delete() public méthode

Delete user from database and remove avatar.
public delete ( integer $id )
$id integer

findAllActivePaginated() public méthode

Find all active users paginated.
public findAllActivePaginated ( integer $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[]
$perPage integer
Résultat Illuminate\Database\Eloquent\Collection | Learner\Models\User[]

findNotActivePaginated() public méthode

Find all not active users paginated.
public findNotActivePaginated ( integer $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[]
$perPage integer
Résultat Illuminate\Database\Eloquent\Collection | Learner\Models\User[]

findTrashedPaginated() public méthode

Find all users in trash paginated.
public findTrashedPaginated ( $perPage = 50 ) : Illuminate\Database\Eloquent\Collection | User[]
Résultat Illuminate\Database\Eloquent\Collection | Learner\Models\User[]

findWithTrashedById() public méthode

Find user by id with trashed.
public findWithTrashedById ( integer $id ) : User
$id integer
Résultat Learner\Models\User

getRegisterForm() public méthode

Get the user creation form service.
public getRegisterForm ( ) : Learner\Services\Forms\UserRegisterFormService.
Résultat Learner\Services\Forms\UserRegisterFormService.

remove() public méthode

Remove the user to trash.
public remove ( integer $id )
$id integer

restore() public méthode

Restore a user from trash.
public restore ( integer $id )
$id integer

toggleActive() public méthode

Change user's status.
public toggleActive ( integer $id ) : boolean
$id integer
Résultat boolean

update() public méthode

Update user.
public update ( integer $id, array $attributes )
$id integer
$attributes array

Property Details

$relations protected_oe static_oe property

The user relate models.
protected static array $relations
Résultat array