alice
alice copied to clipboard
Referencing literal self variables
This code works:
teacher_community_2:
__factory:
from:
id: ~
forename: 'Joshua'
surname: '<lastName()>'
displayName: 'Dr. $surname'
But this one doesn't:
teacher_community_2:
__factory:
from:
id: ~
forename: 'Joshua'
surname: 'Potato'
displayName: 'Dr. $surname'
It throws:
In UnresolvableValueExceptionFactory.php line 77:
Could not find a variable "$surname".
Apparently, the own variables are only available if they come from a Faker source; but not if they are defined as a literal.
@self->surname
does not work either, since it throws:
In ObjectNotFoundExceptionFactory.php line 23:
Could not find the object "teacher_community_2" of the class "Teacher".
Is this a bug or am I missing something in the documentation?
No that definitely looks like a bug.
the own variables are only available if they come from a Faker source
That should not be the case
@self->surname
And this should work