2017 © Pedro Pelรกez
 

symfony-bundle couchdb-odm-bundle

Symfony3 Doctrine CouchDB Bundle

image

martinkronstad/couchdb-odm-bundle

Symfony3 Doctrine CouchDB Bundle

  • Monday, March 27, 2017
  • by martinkronstad
  • Repository
  • 1 Watchers
  • 0 Stars
  • 164 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 44 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Doctrine CouchDB Bundle

This bundle integrates Doctrine CouchDB ODM and Clients into Symfony2., (*1)

STABILITY: Alpha, (*2)

Installation

  • composer require doctrine/couchdb-odm-bundle
  • Add Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle to your Kernel#registerBundles() method
  • If you do not use composer, do not forget to add autoloader for the Doctrine\CouchDB, Doctrine\ODM\CouchDB and Doctrine\Bundle namespaces

To use the annotations, register them in your app/autoload.php file:, (*3)

use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

Documentation

See the Doctrine CouchDB ODM documentation for more information., (*4)

Configuration

The configuration is similar to Doctrine ORM and MongoDB configuration for Symfony2 as its based on the AbstractDoctrineBundle aswell:, (*5)

doctrine_couch_db:
  client:
    dbname: symfony
  odm:
    auto_mapping: true

To dump the configuration reference of this bundle, (*6)

php app/console config:dump-reference doctrine_couch_db

Annotations

An example of how to use annotations with CouchDB and Symfony:, (*7)

<?php
namespace Acme\DemoBundle\CouchDocument;

use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;

/**
 * @CouchDB\Document
 */
class User
{
    /** @CouchDB\Id */
    private $id;
}

Services

You can access to CouchDB services:, (*8)

<?php

namespace Acme\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{
    public function indexAction()
    {
        $client = $this->container->get('doctrine_couchdb.client.default_connection');
        $documentManager = $this->container->get('doctrine_couchdb.odm.default_document_manager');
    }
}

View directories

In @YourBundle/Resources/couchdb/ you can add design documents and corresponding views and have Doctrine CouchDB register them up automatically. For example if you had a design doc "foo" and a view "bar" you could add the following files and directories:, (*9)

Resources/couchdb/
โ””โ”€โ”€ foo/
    โ””โ”€โ”€ views/
        โ””โ”€โ”€ bar/
            โ”œโ”€โ”€ map.js
            โ””โ”€โ”€ reduce.js

You can then update this design document from the CLI by calling:, (*10)

./app/console doctrine:couchdb:update-design-doc foo

Where foo is the name of the design document., (*11)

The Versions

27/03 2017

dev-master

9999999-dev http://www.doctrine-project.org

Symfony3 Doctrine CouchDB Bundle

  Sources   Download

LGPL

The Requires

 

by Benjamin Eberlei
by Lukas Kahwe Smith

symfony couchdb persistence

25/02 2016

2.2

2.2.0.0 http://www.doctrine-project.org

Symfony2 Doctrine CouchDB Bundle

  Sources   Download

LGPL

The Requires

 

by Benjamin Eberlei
by Lukas Kahwe Smith

symfony couchdb persistence

02/09 2015

v2.1-alpha1

2.1.0.0-alpha1 http://www.doctrine-project.org

Symfony2 Doctrine CouchDB Bundle

  Sources   Download

LGPL

The Requires

 

by Benjamin Eberlei
by Lukas Kahwe Smith

symfony couchdb persistence

10/02 2012

dev-license

dev-license http://www.doctrine-project.org

Symfony2 Doctrine CouchDB Bundle

  Sources   Download

LGPL

The Requires

 

by Benjamin Eberlei
by Lukas Kahwe Smith

symfony couchdb persistence