juliangut / doctrine-orm-repositories
Doctrine2 ORM utility entity repositories
Requires
- php: ^7.0
- doctrine/orm: ^2.4
- happyr/doctrine-specification: ^0.7.2
- juliangut/doctrine-base-repositories: ^1.0
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:13:14 UTC
README
doctrine-orm-repositories
Doctrine2 ORM utility entity repositories
Installation
Composer
composer require juliangut/doctrine-orm-repositories
Usage
Use repositoryClass on mapped classes
/** * Comment entity. * * @ORM\Entity(repositoryClass="\Jgut\Doctrine\Repository\ORM\RelationalRepository") */ 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\Repository\ORM\RelationalRepositoryFactory; $config = new \Doctrine\ORM\Configuration; $config->setRepositoryFactory(new RelationalRepositoryFactory); $entityManager = \Doctrine\ORM\EntityManager::create([], $config);
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
Additionally Specification pattern is supported thanks to happyr/doctrine-specification
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.