Add insert, insertWithTransaction and InsertOrFail methods
Closed this issue · 1 comments
artem-prozorov commented
- In repository contract ( https://github.com/artem-prozorov/repos/blob/master/src/Contracts/RepositoryInterface.php ) add 3 methods:
insert(array $data): bool
- this method inserts data into the data storageinsertWithTransaction(array $data): bool
- opens transaction, inserts data and closes transaction. Rolls the transaction back if the data cannot be inserted (partially or completely)insertOrFail(array $data): void
- does exactly the same asinsertWithTransaction
but throws exception if the data cannot be inserted
- Change Abstract repository, Array Repository and Fixturable repository accordingly (https://github.com/artem-prozorov/repos/blob/master/src/AbstractRepository.php, https://github.com/artem-prozorov/repos/blob/master/src/ArrayRepository.php and https://github.com/artem-prozorov/repos/blob/master/src/FixturableRepository.php)
artem-prozorov commented
Done, will appear in the second release