https://github.com/nelmio/alice/blob/master/README.md#multiple-references
group{1..10}:
members: @user{1..10}
this example is giving problem
Entity with Id @user_{1..2} and Class Eggs\CoreBundle\Entity\User not found
It is putting as it is. If i change it to @user_* or @user_1, this works fine, but above range is giving me problem.
Code:
user_{1..10}:
email (unique): email()
group_{1..10}:
user: @user_{1..10}
name: name of the group
user: @user_{1..10} <--- this line gives problem. (I have change business to user)
It is not particularly clear from Alice fixtures' documentation, but this syntax is for when you want to pass an array of users. Does your $group->user
field accept array?
If you want each group to get one user, the solution would be:
group_{1..10}:
user: @user_<current()>
name: name of the group
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With