PHP code example of juliangut / doctrine-mongodb-odm-repositories

1. Go to this page and download the library: Download juliangut/doctrine-mongodb-odm-repositories library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

juliangut / doctrine-mongodb-odm-repositories example snippets


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

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);