juliangut / doctrine-couchdb-odm-repositories
Doctrine2 CouchDB ODM utility entity repositories
Requires
- php: ^7.0
- doctrine/couchdb-odm: dev-master
- juliangut/doctrine-base-repositories: dev-master
- juliangut/doctrine-manager-builder: ^1.3
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.1
- friendsofphp/php-cs-fixer: ^2.0
- humbug/humbug: ~1.0@dev
- phpmd/phpmd: ^2.0
- phpmetrics/phpmetrics: ^2.0
- phpstan/phpstan: ~0.8
- phpunit/phpunit: ^5.7|^6.0
- sebastian/phpcpd: ^2.0
- squizlabs/php_codesniffer: ^2.0
This package is auto-updated.
Last update: 2024-11-15 12:00:41 UTC
README
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.