Download the PHP package doctrine/key-value-store without Composer
On this page you can find all versions of the php package doctrine/key-value-store. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download doctrine/key-value-store
More information about doctrine/key-value-store
Files in doctrine/key-value-store
Package key-value-store
Short Description Simple Key-Value Store Abstraction Layer that maps to PHP objects, allowing for many backends.
License MIT
Informations about the package key-value-store
Doctrine Key Value Stores
The Persistence interfaces are rather overkill for many implementations in the NoSQL world that are only key-value stores with some additional features on top. Doctrine Key Value Store to the rescue. This project offers a much simpler lightweight API that is centered on a key-value API to fetch/save objects.
- Single- or multi-value primary keys
- Unstructured/schema-less values that are mapped onto objects
- Depending on the implementation embedded values/objects are supported
- No complex mapping necessary, just put @Entity on the class and all properties are automatically mapped unless @Transient is given. At least one property has to be @Id. Depends on the underlying vendor though.
- Properties dont have to exist on the class, public properties are created for missing ones.
- No support for references to other objects
- EventListener for ODM/ORM that allows to manage key-value entities and collections of them as properties (postLoad, postUpdate, postPersist, postRemove)
- Stripped down Object Manager Interface
- Data-mapper as any other Doctrine library and persistence and data-objects are separated.
- Inheritance (Single- or Multiple-Storage)
Implementations
Following vendors are targeted:
- Microsoft Azure Table (Implemented)
- Doctrine\Common\Cache provider (Implemented)
- RDBMS (Implemented)
- Couchbase (Implemented)
- Amazon DynamoDB (Implemented)
- CouchDB (Implemented)
- Cassandra
- MongoDB (Implemented)
- Riak (Implemented)
- Redis (Implemented)
We happily accept contributions for any of the drivers.
Example
Suppose we track e-mail campaigns based on campaign id and recipients.
Create
Read
Update
same as create, just reuse the same id.
Delete
Configuration
There is no factory yet that simplifies the creation process, here is the full code necessary to instantiate a KeyValue EntityManager with a Doctrine Cache backend:
If you want to use WindowsAzure Table you can use the following configuration to instantiate the storage:
If you want to use Doctrine DBAL as backend: