PHP Class Learner\Repositories\Eloquent\AbstractRepository

Datei anzeigen Open project: RryLee/learner.video

Protected Properties

Property Type Description
$model Illuminate\Database\Eloquent\Model The model to execute queries on.

Public Methods

Method Description
__construct ( Model $model ) Create a new repository instance.
deleteById ( $id ) : boolean | null Delete the instance from the database.
findById ( integer $id ) : Model | Illuminate\Database\Eloquent\Collection Find instance by gived id.
findByIdWithRelation ( integer $id, string | array $relations ) : Model | Illuminate\Database\Eloquent\Collection Find instance with relation by id.
getNew ( array $attributes = [] ) : Model Get a new instance of the model.

Method Details

__construct() public method

Create a new repository instance.
public __construct ( Model $model )
$model Illuminate\Database\Eloquent\Model The model to execute queries on

deleteById() public method

Delete the instance from the database.
public deleteById ( $id ) : boolean | null
return boolean | null

findById() public method

Find instance by gived id.
public findById ( integer $id ) : Model | Illuminate\Database\Eloquent\Collection
$id integer
return Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection

findByIdWithRelation() public method

Find instance with relation by id.
public findByIdWithRelation ( integer $id, string | array $relations ) : Model | Illuminate\Database\Eloquent\Collection
$id integer
$relations string | array
return Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Collection

getNew() public method

Get a new instance of the model.
public getNew ( array $attributes = [] ) : Model
$attributes array
return Illuminate\Database\Eloquent\Model

Property Details

$model protected_oe property

The model to execute queries on.
protected Model,Illuminate\Database\Eloquent $model
return Illuminate\Database\Eloquent\Model