PHPackages                             doctrine/couchdb-odm - 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. doctrine/couchdb-odm

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

doctrine/couchdb-odm
====================

PHP Doctrine CouchDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to CouchDB.

v1.0.0-alpha3(10y ago)15268.9k↓50%50[10 issues](https://github.com/doctrine/couchdb-odm/issues)[10 PRs](https://github.com/doctrine/couchdb-odm/pulls)6MITPHPPHP &gt;=5.3.2

Since Mar 25Pushed 6y ago14 watchersCompare

[ Source](https://github.com/doctrine/couchdb-odm)[ Packagist](https://packagist.org/packages/doctrine/couchdb-odm)[ Docs](http://www.doctrine-project.org)[ RSS](/packages/doctrine-couchdb-odm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (6)

CouchDB ODM
===========

[](#couchdb-odm)

[![Build Status](https://camo.githubusercontent.com/c1b3f10ce1dcf69282bc1a11075f5d469cc11415264a345449fe2536b7685c38/68747470733a2f2f7472617669732d63692e6f72672f646f637472696e652f636f75636864622d6f646d2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/doctrine/couchdb-odm)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/34ecd50b6468df27842f5b211a70f8ea78338c64d7b4c44a3306514504ef9a61/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f637472696e652f636f75636864622d6f646d2f6261646765732f7175616c6974792d73636f72652e706e673f733d64643763373564303434346231333836613137323036663334366433393130646161386436363862)](https://scrutinizer-ci.com/g/doctrine/couchdb-odm/)

Doctrine CouchDB is a mapper between PHP and CouchDB documents. It uses a metadata mapping pattern to map the documents to plain old php objects, no ActiveRecord pattern or base class of any kind is necessary.

Metadata mapping can be done through annotations, xml, yaml or php. A sample PHP object that is mapped to CouchDB with annotations looks like this:

```
/**
 * @Document
 */
class Article
{
    /** @Id */
    private $id;

    /**
     * @Field(type="string")
     */
    private $topic;

    /**
     * @Field(type="string")
     */
    private $text;

    /**
     * @ReferenceOne(targetDocument="User")
     */
    private $author;

    // a bunch of setters and getters
}
```

A simple workflow with this document looks like:

```
