Php Symfony“;“意外值例外情况”;发射原则:夹具:装载

Php Symfony“;“意外值例外情况”;发射原则:夹具:装载,php,symfony,doctrine-orm,Php,Symfony,Doctrine Orm,我不得不为我的研究做一个口袋妖怪api,我讨厌PHP,但我不想让它变成0/20。。 启动时出现以下错误: php bin/console doctrine:fixtures:load [UnexpectedValueException] Could not determine how to assign last_login to a AppBundle\Entity\Us

我不得不为我的研究做一个口袋妖怪api,我讨厌PHP,但我不想让它变成0/20。。 启动时出现以下错误:

php bin/console doctrine:fixtures:load

[UnexpectedValueException]                                                           
  Could not determine how to assign last_login to a AppBundle\Entity\User\User object
我不明白。。以下是user.yml:

AppBundle\Entity\User\User:
  Matt:
    username: 'Matt'
    email: 'matgmail.com'
    enabled: true
    password: 'trololopokemon'
    last_login: '<dateTimeBetween("-200 days", "now")>'
    level: 1
    xp: 1000
    team: 'red'

  Mika:
      username: 'mickaelTurtle'
      email: 'mickaelTurtle.com'
      enabled: true
      password: 'lifeislife'
      last_login: '<dateTimeBetween("-200 days", "now")>'
      level: 2
      xp: 1200
      team: 'blue'

  Jean:
      username: 'Jean'
      email: 'jean.com'
      enabled: true
      password: 'jeanjean'
      last_login: '<dateTimeBetween("-200 days", "now")>'
      level: 3
      xp: 100
      team: 'yellow'

有人能帮我吗?

您应该使用实体字段的名称,而不是数据库列,因此请尝试使用
lastLogin
而不是
last\u login
。例如:

  Matt:
    username: 'Matt'
    email: 'matgmail.com'
    enabled: true
    password: 'trololopokemon'
    lastLogin: '<dateTimeBetween("-200 days", "now")>'
    level: 1
    xp: 1000
    team: 'red'
Matt:
用户名:“马特”
电子邮件:“matgmail.com”
已启用:true
密码:“trololopokemon”
上次登录:“”
级别:1
xp:1000
团队:“红色”
希望这有帮助

  Matt:
    username: 'Matt'
    email: 'matgmail.com'
    enabled: true
    password: 'trololopokemon'
    lastLogin: '<dateTimeBetween("-200 days", "now")>'
    level: 1
    xp: 1000
    team: 'red'