It's possible to embed php code in symfony's yml fixture file. My tab开发者_StackOverflow社区le entry needs a foreign key id. Is it possible through the embedded php to get the last inserted id of the referenced table or any other way which doesn't involve setting the foreign ids manually?
Thanks in advance
Do not use ids in your fixture. Do not use foreign_key columns. Use relations instead, like this:
ACLass:
a_instance:
title: 'pwet'
BClass:
b_instance:
name: My b object
AObject: a_instance
精彩评论