开发者

generate models and database using doctrine yml file in modular structure zend project

I have been using doctrine with zend in a project without modules. It is working fine.

But now I am wor开发者_StackOverflow社区king on zend project with different modules in it. structure is something like that

application
---modules
------admin
---------models
---------controllers
---------views

I have a yml schema

options:
    type: INNODB
    collate: utf8_general_ci
    charset: utf8
User:
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    name: string(255)
    email: string(300)

and I am runing this command on shell to generate models and db.

shell> ./doctrine build-all-reload

and it is generate the models directly under APPLICATION folder. While I want to generate the models in APPLICATION -> MODULES -> ADMIN -> MODELS folder

Please guide me, what configuration I need to do to achieve above results.


You can pass a configuration array with 'models_path' to the Doctrine_Cli constructor.

$config = array(
    'models_path' => APPLICATION_PATH . '/modules/admin/models'
);

$cli = new Doctrine_Cli($config);

See http://www.doctrine-project.org/projects/orm/1.2/docs/manual/utilities/en#command-line-interface for more about the cli configuration options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜