我有一个具有大型模式的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命令行界面,想知道如何使用Doctrine2来映射和自动生成模型和实体等?
发布于 2012-03-17 05:54:35
我想通了!我跑了
php doctrine-cli.php orm:convert-mapping --from-database yml /(your destination folder)/
它根据我已经就地的DB模式自动生成实体类
https://stackoverflow.com/questions/9728158
复制相似问题