fainohub/hyperf-doctrine-odm
最新稳定版本:v2.1.0
Composer 安装命令:
composer require fainohub/hyperf-doctrine-odm
包简介
Hyperf Doctrine ODM
README 文档
README
Doctrine MongoDB Object Document Mapper (ODM) for Hyperf framework.
Notice: coroutines are not supported
Installation
composer require fainohub/hyperf-doctrine-odm Setup
php bin/hyperf.php vendor:publish fainohub/hyperf-doctrine-odm Configure the doctrine in config/autoload/doctrine-odm.php:
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' => [ // ], ];
Generate Hydrators:
php bin/hyperf.php doctrine:generate-hydrators Generate Proxies:
php bin/hyperf.php doctrine:generate-proxies Generate Persistent Collections:
php bin/hyperf.php doctrine:generate-persistent-collections Automatically generate in composer.json
"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", ] } 统计信息
- 总下载量: 36.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04