PHP Class REBELinBLUE\Deployer\Repositories\EloquentRepository

ファイルを表示 Open project: rebelinblue/deployer Class Usage Examples

Protected Properties

Property Type Description
$model Illuminate\Database\Eloquent\Model An instance of the model.

Public Methods

Method Description
create ( array $fields ) : Model Creates a new instance of the model.
deleteById ( integer $model_id ) : boolean Delete an instance by it's ID.
getAll ( ) : Illuminate\Database\Eloquent\Collection Get's all records from the model.
getById ( integer $model_id ) : Model Get's an item from the repository.
updateById ( array $fields, integer $model_id ) : Model Updates an instance by it's ID.

Method Details

create() public method

Creates a new instance of the model.
public create ( array $fields ) : Model
$fields array
return Illuminate\Database\Eloquent\Model

deleteById() public method

Delete an instance by it's ID.
public deleteById ( integer $model_id ) : boolean
$model_id integer
return boolean

getAll() public method

Get's all records from the model.
public getAll ( ) : Illuminate\Database\Eloquent\Collection
return Illuminate\Database\Eloquent\Collection

getById() public method

Get's an item from the repository.
public getById ( integer $model_id ) : Model
$model_id integer
return Illuminate\Database\Eloquent\Model

updateById() public method

Updates an instance by it's ID.
public updateById ( array $fields, integer $model_id ) : Model
$fields array
$model_id integer
return Illuminate\Database\Eloquent\Model

Property Details

$model protected_oe property

An instance of the model.
protected Model,Illuminate\Database\Eloquent $model
return Illuminate\Database\Eloquent\Model