CouchDB ODM

基于CouchDB的Document Mapper。(A Document Mapper based on CouchDB.)

Github星跟蹤圖

CouchDB ODM

Doctrine CouchDB是PHP和CouchDB文档之间的映射器。 它使用元数据映射模式将文档映射到普通的旧php对象,不需要任何类型的ActiveRecord模式或基类。

元数据映射可以通过注释、xml、yaml或php完成。 使用注释映射到CouchDB的示例PHP对象如下所示:

/**
 * @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
}

此文档的简单工作流程如下所示:

 <?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();

您可以使用每个git checkout的沙箱/文件夹中提供的沙箱,或者阅读文档 http://docs.doctrine-project.org/projects/doctrine-couchdb/en/latest/

主要指標

概覽
名稱與所有者doctrine/couchdb-odm
主編程語言PHP
編程語言PHP (語言數: 2)
平台BSD, Linux, Mac, Windows
許可證MIT License
所有者活动
創建於2010-09-18 09:37:23
推送於2019-09-02 14:16:11
最后一次提交2019-03-12 02:20:21
發布數3
最新版本名稱v1.0.0-alpha3 (發布於 2015-11-11 19:36:57)
第一版名稱1.0.0alpha1 (發布於 2011-05-27 20:58:54)
用户参与
星數149
關注者數14
派生數53
提交數512
已啟用問題?
問題數55
打開的問題數20
拉請求數64
打開的拉請求數10
關閉的拉請求數25
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

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 https://www.doctrine-project.org/projects/doctrine-couchdb-odm/en/latest/index.html