我必须为我的学习做一个Pokemongo API,我讨厌PHP,但我不想拥有0/20。启动时我有一个错误:
php bin/console doctrine:fixtures:load
[UnexpectedValueException]
Could not determine how to assign last_login to a AppBundleEntityUserUser object
我不明白..这是user.yml:
AppBundleEntityUserUser:
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'
这是我的user.php中的行:
/**
* @var DateTime
*
* @ORMColumn(name="last_login", type="datetime")
*/
protected $lastLogin;
有人可以帮助我吗?
您应该使用实体字段的名称而不是数据库列,因此请尝试使用lastLogin
而不是last_login
。例如:
Matt:
username: 'Matt'
email: 'matgmail.com'
enabled: true
password: 'trololopokemon'
lastLogin: '<dateTimeBetween("-200 days", "now")>'
level: 1
xp: 1000
team: 'red'
希望此帮助