PHP Class Sleimanx2\Plastic\Persistence\EloquentPersistence

Show file Open project: sleimanx2/plastic Class Usage Examples

Protected Properties

Property Type Description
$connection Sleimanx2\Plastic\Connection
$model Illuminate\Database\Eloquent\Model

Public Methods

Method Description
__construct ( Connection $connection ) PersistenceAbstract constructor.
bulkDelete ( array | collection $collection = [] ) : mixed Bulk Delete a collection of Models.
bulkSave ( array | Collection $collection = [] ) : mixed Bulk save a collection Models.
delete ( ) : mixed Delete a model document.
getModel ( ) : Model Get the model to persist.
model ( Model $model ) Set the model to persist.
reindex ( array | Collection $collection = [] ) : mixed Reindex a collection of Models.
save ( ) : mixed Save a model instance.
update ( ) : mixed Update a model document.

Private Methods

Method Description
exitIfModelNotSet ( ) Function called when the model value is a required.

Method Details

__construct() public method

PersistenceAbstract constructor.
public __construct ( Connection $connection )
$connection Sleimanx2\Plastic\Connection

bulkDelete() public method

Bulk Delete a collection of Models.
public bulkDelete ( array | collection $collection = [] ) : mixed
$collection array | collection
return mixed

bulkSave() public method

Bulk save a collection Models.
public bulkSave ( array | Collection $collection = [] ) : mixed
$collection array | Illuminate\Support\Collection
return mixed

delete() public method

Delete a model document.
public delete ( ) : mixed
return mixed

getModel() public method

Get the model to persist.
public getModel ( ) : Model
return Illuminate\Database\Eloquent\Model

model() public method

Set the model to persist.
public model ( Model $model )
$model Illuminate\Database\Eloquent\Model

reindex() public method

Reindex a collection of Models.
public reindex ( array | Collection $collection = [] ) : mixed
$collection array | Illuminate\Support\Collection
return mixed

save() public method

Save a model instance.
public save ( ) : mixed
return mixed

update() public method

Update a model document.
public update ( ) : mixed
return mixed

Property Details

$connection protected property

protected Connection,Sleimanx2\Plastic $connection
return Sleimanx2\Plastic\Connection

$model protected property

protected Model,Illuminate\Database\Eloquent $model
return Illuminate\Database\Eloquent\Model