开发者

How can I use fixtures in Doctrine 2?

开发者 https://www.devze.com 2023-01-10 18:10 出处:网络
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.

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

精彩评论

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