PHP Class App\Repositories\Setting\EloquentSetting

Inheritance: extends app\repositories\AbstractEloquentRepository, implements App\Repositories\Setting\SettingInterface
Show file Open project: ngmy/webloyer

Public Methods

Method Description
__construct ( Model $setting ) : void Create a new repository instance.
byType ( $type ) : Model Get a model by setting type. If a model does not exist, create a new model.
updateByType ( array $data ) : boolean Update an existing model has a same type.

Method Details

__construct() public method

Create a new repository instance.
public __construct ( Model $setting ) : void
$setting Illuminate\Database\Eloquent\Model
return void

byType() public method

Get a model by setting type. If a model does not exist, create a new model.
public byType ( $type ) : Model
return Illuminate\Database\Eloquent\Model

updateByType() public method

Update an existing model has a same type.
public updateByType ( array $data ) : boolean
$data array Data to update a model
return boolean