Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Doctrine2+;CodeIgniter 2数据库映射_Php_Mysql_Codeigniter_Doctrine Orm - Fatal编程技术网

Php Doctrine2+;CodeIgniter 2数据库映射

Php Doctrine2+;CodeIgniter 2数据库映射,php,mysql,codeigniter,doctrine-orm,Php,Mysql,Codeigniter,Doctrine Orm,我有一个MySQL数据库,已经有了一个庞大的模式,并使用MySQL工作台插件将结构导出到Doctrine2的.yml文件中 导出的YML文件示例: twitter: columns: TwitterId: type: integer(4) primary: true notnull: true UserId: type: integer(4) notn

我有一个MySQL数据库,已经有了一个庞大的模式,并使用MySQL工作台插件将结构导出到Doctrine2的.yml文件中

导出的YML文件示例:

 twitter:
      columns:
        TwitterId:
          type: integer(4)
          primary: true
          notnull: true
        UserId:
          type: integer(4)
          notnull: true
      relations:
        User:
          class: user
          local: UserId
          foreign: UserId
          foreignAlias: twitters
      indexes:
        FK_Twitter_User:
          fields: [UserId]

我正在使用Doctrine2 CLI,想知道如何使用Doctrine2来映射和自动生成模型和实体等?

我明白了!我跑

php doctrine-cli.php orm:convert-mapping --from-database yml /(your destination folder)/
它根据我已经就位的DB模式自动生成实体类