couchdb-odm 0 travis-ci Packagist phpunit

A Document Mapper based on CouchDB

CouchDB ODM

Build Status Scrutinizer Quality Score

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:

<?php
$article = new Article();
$article->setTopic("Doctrine CouchDB");
$article->setText("Documentation");
$article->setAuthor(new Author("beberlei"));

// creating the document
$dm->persist($article);
$dm->flush();

$article = $dm->find("Article", 1234);
$article->setText("Documentation, and more documentation!");

// update the document
$dm->flush();

// removing the document
$dm->remove($article);
$dm->flush();

You can play around with the sandbox shipped in the sandbox/ folder of every git checkout or read the documentation at http://docs.doctrine-project.org/projects/doctrine-couchdb/en/latest/

Related Repositories

couchdb-odm

couchdb-odm

A Document Mapper based on CouchDB ...

exegesis

exegesis

a ruby ODM for couchdb ...

footrest

footrest

Lightweight CouchDB ODM written in CoffeeScript ...

couchdb-documentation

couchdb-documentation

Documentation for Doctrine CouchDB ODM ...

odm

odm

PHP 5.3 Object Document Mapper for MongoDB, CouchDB, etc. ...


Top Contributors

beberlei lsmith77 PATROMO kore marnusw bartfaitamas naderman lucifurious janpieper taion809 igorw dbu goatherd Ocramius stof hlubek fdomig guilhermeblanco wilonth kevinyien meckhardt mehrdadmhd ngroot dragoonis saem schaumiii Powerhamster tobmaster

Releases

-   v1.0.0-alpha3 zip tar
-   1.0.0alpha1 zip tar
-   1.0.0ALPHA2 zip tar