PHP Class League\FactoryMuffin\Stores\RepositoryStore

Author: Graham Campbell ([email protected])
Author: Michael Bodnarchuk ([email protected])
Inheritance: extends AbstractStore, implements League\FactoryMuffin\Stores\StoreInterface
Datei anzeigen Open project: zizaco/factory-muff

Protected Properties

Property Type Description
$storage object For Doctrine, this will be an EntityManager instance.

Public Methods

Method Description
__construct ( object $storage, string | null $saveMethod = null, string | null $deleteMethod = null, $flushMethod = null ) : void Create a new repository store instance.
deleteSaved ( ) : void Delete all the saved models.

Protected Methods

Method Description
delete ( object $model ) : boolean Delete our object from the db.
flush ( ) : boolean Flushes changes to storage.
save ( object $model ) : boolean Save our object to the db, and keep track of it.

Method Details

__construct() public method

Create a new repository store instance.
public __construct ( object $storage, string | null $saveMethod = null, string | null $deleteMethod = null, $flushMethod = null ) : void
$storage object
$saveMethod string | null
$deleteMethod string | null
return void

delete() protected method

Delete our object from the db.
protected delete ( object $model ) : boolean
$model object The model instance.
return boolean

deleteSaved() public method

Delete all the saved models.
public deleteSaved ( ) : void
return void

flush() protected method

Flushes changes to storage.
protected flush ( ) : boolean
return boolean

save() protected method

Save our object to the db, and keep track of it.
protected save ( object $model ) : boolean
$model object The model instance.
return boolean

Property Details

$storage protected_oe property

For Doctrine, this will be an EntityManager instance.
protected object $storage
return object