PHP Class Owl\Repositories\Eloquent\UserRepository

Inheritance: implements Owl\Repositories\UserRepositoryInterface
Mostra file Open project: owl/owl

Protected Properties

Property Type Description
$user

Public Methods

Method Description
__construct ( User $user )
create ( mixed $credentials ) : Illuminate\Database\Eloquent\Model Create a new user.
getAll ( ) : Illuminate\Database\Eloquent\Collection Get all user data.
getByEmail ( string $email ) : Illuminate\Database\Eloquent\Model Get a user by email.
getById ( integer $id ) : Illuminate\Database\Eloquent\Model Get a user by user id.
getByUsername ( string $username ) : Illuminate\Database\Eloquent\Model Get a user by username.
getLikeUsername ( string $username ) : Illuminate\Database\Eloquent\Model Get users by username like search.
getOwners ( ) : Illuminate\Database\Eloquent\Model Get users which role is owner.
getUsersToArray ( $users ) : array get users array
updateUser ( integer $id, string $username, string $email, $role ) : Illuminate\Database\Eloquent\Model Update a user information(username, email, role).

Method Details

__construct() public method

public __construct ( User $user )
$user Owl\Repositories\Eloquent\Models\User

create() public method

Create a new user.
public create ( mixed $credentials ) : Illuminate\Database\Eloquent\Model
$credentials mixed (email, username, password, role)
return Illuminate\Database\Eloquent\Model

getAll() public method

Get all user data.
public getAll ( ) : Illuminate\Database\Eloquent\Collection
return Illuminate\Database\Eloquent\Collection | Illuminate\Database\Eloquent\Builder

getByEmail() public method

Get a user by email.
public getByEmail ( string $email ) : Illuminate\Database\Eloquent\Model
$email string
return Illuminate\Database\Eloquent\Model

getById() public method

Get a user by user id.
public getById ( integer $id ) : Illuminate\Database\Eloquent\Model
$id integer
return Illuminate\Database\Eloquent\Model

getByUsername() public method

Get a user by username.
public getByUsername ( string $username ) : Illuminate\Database\Eloquent\Model
$username string
return Illuminate\Database\Eloquent\Model

getLikeUsername() public method

Get users by username like search.
public getLikeUsername ( string $username ) : Illuminate\Database\Eloquent\Model
$username string
return Illuminate\Database\Eloquent\Model

getOwners() public method

Get users which role is owner.
public getOwners ( ) : Illuminate\Database\Eloquent\Model
return Illuminate\Database\Eloquent\Model

getUsersToArray() public method

get users array
public getUsersToArray ( $users ) : array
return array

updateUser() public method

Update a user information(username, email, role).
public updateUser ( integer $id, string $username, string $email, $role ) : Illuminate\Database\Eloquent\Model
$id integer
$username string
$email string
return Illuminate\Database\Eloquent\Model

Property Details

$user protected_oe property

protected $user