Download the PHP package carlosv2/dumbsmart-repositories without Composer
On this page you can find all versions of the php package carlosv2/dumbsmart-repositories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carlosv2/dumbsmart-repositories
More information about carlosv2/dumbsmart-repositories
Files in carlosv2/dumbsmart-repositories
Package dumbsmart-repositories
Short Description Simplistic layer to store documents into their own repositories
License MIT
Informations about the package dumbsmart-repositories
Dumbsmart Repositories
This project provides a layer that sits in between your project and a collection of fake repositories so that each document is stored into its own repository regardless of whether it was persisted as a relation of another object. This layer is designed to be used on testing environments or on low data-level-access applications. Using this project in production is discouraged.
Why?
When using fake repositories is common to use functions like serialize
or json_encode
in order to make
data easily persistable. A side effects of using these methods is that related documents are stored along with
the parent document. As a result, querying this document from its own repository produces no results, and modifying
its data means loading any potential document related with the one that must be modified.
This is usually not a problem for small projects, but with large projects where data is complex, unforseen consequences can ensue.
Installation
Install with:
Usage
Imagine you have the following entities:
In order to use them, you first need to configure this layer:
Once you have configured the layer, you can start using it like this:
If you were using everzet/persisted-objects previously, you don't even need to modify your code, only the way you build your repositories:
All versions of dumbsmart-repositories with dependencies
carlosv2/communism Version ^1.2
php Version ~5.3 || ~7.0