承接 tourze/doctrine-entity-markdown-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

tourze/doctrine-entity-markdown-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require tourze/doctrine-entity-markdown-bundle

包简介

基于 Doctrine 实体生成数据库字典的 Symfony Bundle

README 文档

README

English | 中文

Latest Version PHP Version License Build Status Code Coverage

A Symfony Bundle for generating Markdown format database dictionaries from Doctrine entities.

Features

  • Generate complete database table listings
  • Generate detailed field information for each table including field types, length, nullable status, default values, comments, etc.
  • Handle associations between entities
  • Support MCP (Model Context Protocol) tool integration for AI assistants

Installation

composer require tourze/doctrine-entity-markdown-bundle

Configuration

Add the bundle to your config/bundles.php:

return [
    // ...
    Tourze\DoctrineEntityMarkdownBundle\DoctrineEntityMarkdownBundle::class => ['all' => true],
];

Requirements

This package requires the following components:

  • PHP ^8.1
  • Symfony ^7.3
  • Doctrine ORM ^3.0
  • Doctrine Bundle ^2.13

Quick Start

Command Line Usage

Generate Markdown format database dictionary using the following command:

bin/console doctrine:generate:markdown

Usage in Code

use Tourze\DoctrineEntityMarkdownBundle\Service\EntityServiceInterface;

class YourController
{
    public function __construct(
        private readonly EntityServiceInterface $entityService,
    ) {
    }
    
    public function generateDictionary()
    {
        // Get all table names
        $tableList = $this->entityService->getAllTableNames();
        
        // Get metadata for a specific entity
        $userMetadata = $this->entityService->getEntityMetadata('App\Entity\User');
        
        // Get metadata for all entities
        $allMetadata = $this->entityService->getAllEntitiesMetadata();
        
        // Generate complete database dictionary
        $fullMarkdown = $this->entityService->generateDatabaseMarkdown();
    }
}

Advanced Usage

MCP Tool Integration

This package provides MCP (Model Context Protocol) tools for AI assistant integration:

use Tourze\DoctrineEntityMarkdownBundle\MCP\Tool\GetDatabaseDictionary;

// Get database dictionary through MCP
$tool = new GetDatabaseDictionary($entityService);
$result = $tool->execute();

Custom Output Format

You can extend the EntityService class to customize the output format:

class CustomEntityService extends EntityService
{
    public function generateCustomMarkdown(): string
    {
        // Custom generation logic
        return $this->generateDatabaseMarkdown();
    }
}

Testing

Run unit tests:

./vendor/bin/phpunit packages/doctrine-entity-markdown-bundle/tests

Contributing

Please feel free to submit issues and pull requests. Make sure to follow the existing code style and add tests for any new functionality.

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

  • 总下载量: 119
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固