Php Doctrine2+;CodeIgniter 2数据库映射
我有一个MySQL数据库,已经有了一个庞大的模式,并使用MySQL工作台插件将结构导出到Doctrine2的.yml文件中 导出的YML文件示例: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
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模式自动生成实体类