PHP Class Learner\Repositories\Eloquent\UserRepository

Inheritance: extends AbstractRepository, implements Learner\Repositories\UserRepositoryInterface
Datei anzeigen Open project: RryLee/learner.video

Protected Properties

Property Type Description
$relations array The user relate models.

Public Methods

Method 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 method

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

attachRole() public method

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

attachRoleById() public method

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

create() public method

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

delete() public method

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

findAllActivePaginated() public method

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

findNotActivePaginated() public method

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

findTrashedPaginated() public method

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

findWithTrashedById() public method

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

getRegisterForm() public method

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

remove() public method

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

restore() public method

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

toggleActive() public method

Change user's status.
public toggleActive ( integer $id ) : boolean
$id integer
return boolean

update() public method

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
return array