juliangut/doctrine-couchdb-odm-repositories

Doctrine2 CouchDB ODM utility entity repositories

dev-master 2017-10-30 22:13 UTC

This package is auto-updated.

Last update: 2024-11-15 12:00:41 UTC


README

PHP version Latest Version License

Build Status Style Check Code Quality Code Coverage

Total Downloads Monthly Downloads

doctrine-couchdb-odm-repositories

Doctrine2 CouchDB ODM utility entity repositories

Important notice

This package is currently broken due to Doctrine\ODM\CouchDB\DocumentRepository::refresh being defined as final. This is a situation impossible to be solved by this package that makes it unusable. I've not time nor especial interest in supporting this package, feel free to fork.

Installation

Composer

composer require juliangut/doctrine-couchdb-odm-repositories

Usage

Use repositoryClass on mapped classes

/**
 * Comment CouchDB document.
 *
 * @ODM\Document(repositoryClass="\Jgut\Doctrine\Repository\CouchDBRepository")
 */
class Comment
{
}

Register factory on managers

When creating object managers you can set a repository factory to create default repositories such as follows

use Jgut\Doctrine\ManagerBuilder\CouchDB\DocumentManager;
use Jgut\Doctrine\Repository\Factory\CouchDBRepositoryFactory;

$documentManager = DocumentManager::create([], new \Doctrine\ODM\CouchDB\Configuration);
$documentManager->setRepositoryFactory(new CouchDBRepositoryFactory);

For an easier way of registering repository factories and managers generation in general have a look at juliangut/doctrine-manager-builder

Functionalities

Head to juliangut/doctrine-base-repositories for a full list of new functionalities provided by the repository

Performance

Due to the lack of a Query Builder such as the ones present in Doctrine ORM and Doctrine MongoDB ODM the paginating and counting operations are vastly inefficient as they need the whole set loaded in memory

Contributing

Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.

See file CONTRIBUTING.md

License

See file LICENSE included with the source code for a copy of the license terms.