PHP Class Learner\Repositories\Eloquent\AbstractRepository

Afficher le fichier Open project: RryLee/learner.video

Protected Properties

Свойство Type Description
$model Illuminate\Database\Eloquent\Model The model to execute queries on.

Méthodes publiques

Méthode 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 méthode

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

deleteById() public méthode

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

findById() public méthode

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

findByIdWithRelation() public méthode

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

getNew() public méthode

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

Property Details

$model protected_oe property

The model to execute queries on.
protected Model,Illuminate\Database\Eloquent $model
Résultat Illuminate\Database\Eloquent\Model