开发者

How can I use fixtures in Doctrine 2?

Does anybody can get me started on using fixtures in doctrine 2? In doctrine 1 this was easy. But in the doctrine 2 documentation there's n开发者_Go百科othing I can find about fixtures.

Thanks.


YAML data fixtures no longer exist in Doctrine 2.

you can use use regular PHP code to load data fixtures.

see this link

http://www.symfony-project.org/blog/2009/10/05/symfony-and-doctrine-2


There are now data fixtures for Doctrine 2: https://github.com/doctrine/data-fixtures


I would recommend setting up Migrations and creating some 'fixture' Migrations. This is the best approach I've encountered thus far (however I'm using Zend Framework, Haim's suggestion may be better if you're using Symfony).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜