I'm using Alice in a Symfony 2 bundle to load fixtures. I'm trying to customize the name of an entity using the name of a parent entity. Specifically, I have an entity, @Report1
, whose @Report1->name
property returns Test Report 1
.
I'm trying to create a child entity with the name Test Report 1 Scenario 1
. Here's my fixture file snippet:
AppBundle\Entity\Scenario:
Scenario1:
report_id: @Report1->id
name: @Report1->name 'Scenario 1'
All I get back is the literal @Report1->name 'Scenario 1'
.
If I remove the 'Scenario 1'
string from thename:
property, I get the parent report's actual name.
Another option that worked for me was using sprintf
:
App\Entity\User:
users{1..150}:
firstname: '<firstname()>'
lastname: '<lastname()>'
email: '<sprintf("%s.%[email protected]", @self->firstname, @self->lastname)>'
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