定制 fainohub/hyperf-doctrine-odm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-25