brunnofoggia/doctrine-rhino 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

brunnofoggia/doctrine-rhino

Composer 安装命令:

composer require brunnofoggia/doctrine-rhino

包简介

Utility to read the database structure

README 文档

README

Minimum PHP Version License

Utility to read the database structure

usage

  1. Implement it into your class

     class Test {
         use \doctrine\Rhino;
     }
    
  2. Connect to DBAL and set your connection

     $this->setConn($connection);
    
  3. Get All Table Data (name, columns, relations and indexes) calling

     $this->getTableData('table_name');
        
    

    An example of the result set would be

        array (
       'table' => 'test',
       'columns' => 
       array (
         'id' => 
         Doctrine\DBAL\Schema\Column::__set_state(array(
            '_type' => 
           Doctrine\DBAL\Types\IntegerType::__set_state(array(
           )),
            '_length' => NULL,
            '_precision' => 10,
            '_scale' => 0,
            '_unsigned' => false,
            '_fixed' => false,
            '_notnull' => true,
            '_default' => NULL,
            '_autoincrement' => true,
            '_platformOptions' => 
           array (
           ),
            '_columnDefinition' => NULL,
            '_comment' => NULL,
            '_customSchemaOptions' => 
           array (
           ),
            '_name' => 'id',
            '_namespace' => NULL,
            '_quoted' => false,
         )),
         'name' => 
         Doctrine\DBAL\Schema\Column::__set_state(array(
            '_type' => 
           Doctrine\DBAL\Types\StringType::__set_state(array(
           )),
            '_length' => 50,
            '_precision' => 10,
            '_scale' => 0,
            '_unsigned' => false,
            '_fixed' => false,
            '_notnull' => true,
            '_default' => NULL,
            '_autoincrement' => false,
            '_platformOptions' => 
           array (
             'collation' => 'latin1_swedish_ci',
           ),
            '_columnDefinition' => NULL,
            '_comment' => NULL,
            '_customSchemaOptions' => 
           array (
           ),
            '_name' => 'nome',
            '_namespace' => NULL,
            '_quoted' => false,
         )),
       ),
       'belongsTo' => 
       array (
       ),
       'hasMany' => 
       array (
         0 => 
         array (
           'foreignTableName' => 'test_many',
           'columns' => 
           array (
             0 => 'test_id',
           ),
         ),
       ),
       'indexes' => 
       array (
         'primary' => 
         Doctrine\DBAL\Schema\Index::__set_state(array(
            '_columns' => 
           array (
             'id' => 
             Doctrine\DBAL\Schema\Identifier::__set_state(array(
                '_name' => 'id',
                '_namespace' => NULL,
                '_quoted' => false,
             )),
           ),
            '_isUnique' => true,
            '_isPrimary' => true,
            '_flags' => 
           array (
           ),
            'options' => 
           array (
           ),
            '_name' => 'PRIMARY',
            '_namespace' => NULL,
            '_quoted' => false,
         )),
       ),
     )
    

    Optionally get only what want by using one of the listed bellow

     $columns = $this->getSm()->listTableColumns($table); // list of collumns
     $indexes = $this->getSm()->listTableIndexes($table); // list of indexes
     $belongsTo = $this->discoverBelongsTo($table); // list of belongsTo relations
     $hasMany = $this->discoverHasMany($table); // list of hasMany relations
    

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-01-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固