zebrainsteam/repos

Add insert, insertWithTransaction and InsertOrFail methods

Closed this issue · 1 comments

  1. 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 storage
  • insertWithTransaction(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 as insertWithTransaction but throws exception if the data cannot be inserted
  1. 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)

Done, will appear in the second release