Doctrine2 MongoDB ODM utility entity repositories
composer require juliangut/doctrine-mongodb-odm-repositories
Might need "--ignore-platform-reqs" flag
/**
* Comment MongoDB document.
*
* @ODM\Document(repositoryClass="\Jgut\Doctrine\Repository\MongoDB\ODM\MongoDBRepository")
*/
class Comment
{
}
When creating object managers you can set a repository factory to create default repositories such as follows
use Jgut\Doctrine\Repository\Factory\MongoDBRepositoryFactory;
$config = new \Doctrine\ODM\MongoDB\Configuration;
$config->setRepositoryFactory(new MongoDBRepositoryFactory);
$documentManager = \Doctrine\ODM\MongoDB\DocumentManager::create(new \Doctrine\MongoDB\Connection(...), $config);
For an easier way of registering repository factories and managers generation in general have a look at juliangut/doctrine-manager-builder
Head to juliangut/doctrine-base-repositories for a full list of new functionalities provided by the repository
Found a bug or have a feature request? Please open a new issue. Have a look at existing issues before.
See file CONTRIBUTING.md
See file LICENSE included with the source code for a copy of the license terms.