doctrine/couchdb-odm 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

doctrine/couchdb-odm

最新稳定版本:v1.0.0-alpha3

Composer 安装命令:

composer require doctrine/couchdb-odm

包简介

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

README 文档

README

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

统计信息

  • 总下载量: 68.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 152
  • 点击次数: 0
  • 依赖项目数: 8
  • 推荐数: 3

GitHub 信息

  • Stars: 151
  • Watchers: 17
  • Forks: 53
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2011-10-11