PHPackages                             lesha888/doctrine-key-value-store - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. lesha888/doctrine-key-value-store

ActiveLibrary[Database &amp; ORM](/categories/database)

lesha888/doctrine-key-value-store
=================================

Simple Key-Value Store Abstraction Layer that maps to PHP objects, allowing for many backends.

v0.2(10y ago)011MITPHP

Since Apr 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lesha888/KeyValueStore)[ Packagist](https://packagist.org/packages/lesha888/doctrine-key-value-store)[ RSS](/packages/lesha888-doctrine-key-value-store/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (9)Used By (0)

Doctrine Key Value Stores
=========================

[](#doctrine-key-value-stores)

[![Build Status](https://camo.githubusercontent.com/c61216bfbebbe4cb3d37ee43ca670a4368e7d19d74dab12ec95f1e5f214fbba1/68747470733a2f2f7472617669732d63692e6f72672f646f637472696e652f4b657956616c756553746f72652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/doctrine/KeyValueStore)

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
---------------

[](#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
-------

[](#example)

Suppose we track e-mail campaigns based on campaign id and recipients.

```
