如何强制插入爱丽丝夹具?

时间:2019-02-20 12:33:37

标签: php symfony doctrine-orm nelmio-alice alice-fixtures

我在Alice固定装置中遇到参考问题。我想稍后插入值,而不是引用,因为我想将此数据插入现有数据库中。

Account_User2:
    # Generated here
    account_id (unique): 1
    account_type_id: 2 # <- here i would like to insert int, not reference
    user_id: '@User2->user_id'
    account_title: '@User2->first_name @User2->last_name'
    is_enabled: 1

爱丽丝3 +

Php 7 +

错误:

Expected value of type "\AccountType" for association field "\Account#$account_type_id", got "integer" instead.

任何想法如何强制插入值,而不是引用?

1 个答案:

答案 0 :(得分:1)

在github上有一个问题和一个答案:https://github.com/hautelook/AliceBundle/issues/443