PHP code example of fainohub / hyperf-doctrine-odm

1. Go to this page and download the library: Download fainohub/hyperf-doctrine-odm 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/ */

    

fainohub / hyperf-doctrine-odm example snippets


return [
    'connection' => [
        'server' => env('MONGO_DB_DSN', 'mongodb://mongodb:27017'),
        'database' => env('MONGO_DB_DATABASE', 'db'),
    ],

    'hydrator' => [
        'namespace' => 'MongoDbHydrator',
        'path' => BASE_PATH . '/cache/MongoDbHydrators',
    ],

    'proxy' => [
        'namespace' => 'MongoDbProxy',
        'path' => BASE_PATH . '/cache/MongoDbProxies',
    ],

    'collection' => [
        'namespace' => 'PersistentCollections',
        'path' => BASE_PATH . '/cache/PersistentCollections',
    ],

    'mapping' => [
        'driver' => 'xml', //xml or annotation
        'extension' => '.dcm.xml',
        'paths' => [
            //
        ]
    ],

    'persistent_collections' => [
        //
    ],

    'types' => [
        //
    ],
];

php bin/hyperf.php vendor:publish fainohub/hyperf-doctrine-odm

php bin/hyperf.php doctrine:generate-hydrators

php bin/hyperf.php doctrine:generate-proxies

php bin/hyperf.php doctrine:generate-persistent-collections

"scripts": {
    "post-autoload-dump": [
        "@php bin/hyperf.php doctrine:generate-hydrators",
        "@php bin/hyperf.php doctrine:generate-proxies",
        "@php bin/hyperf.php doctrine:generate-persistent-collections",
    ]
}