Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access nested reference property #1116

Open
NotionCommotion opened this issue Jul 30, 2022 · 0 comments
Open

Can't access nested reference property #1116

NotionCommotion opened this issue Jul 30, 2022 · 0 comments

Comments

@NotionCommotion
Copy link

NotionCommotion commented Jul 30, 2022

The second however should work, but maybe @self->city->postalCodes will do?

Originally posted by @theofidry in #1019 (comment)

I believe @self->city->postalCodes is a good solution, but it doesn't appear to work. Config is below and error output below that. Using hautelook/alice-bundle 2.11.0, nelmio/alice v3.11.0, and theofidry/alice-data-fixtures 1.6.0. As a workaround, I added method VendorUser::getOrganizationsTenant() which works, however, @self->organization->tenant is nicer.

App\Entity\Organization\Tenant:
    tenant_organization_{1..5}:
        __factory: { 'App\Entity\Organization\Tenant::create': [] }
        name: <company()>

App\Entity\Organization\Vendor:
    vendor_organization_{1..5}:
        name: <company()>
        tenant: '@tenant_organization_*'

App\Entity\User\VendorUser:
    vendor_user_{1..15}:
        organization: '@vendor_organization_*'
        tenant: '@self->organization->tenant'
        #tenant: '@self->organization->getTenant()'
        #tenant: '@self->organizationsTenant'
        firstName: '<firstName()>'
        lastName: '<lastName()>'
        username: '<username()>'
        plainPassword: 'changeMe'
        jobTitle: '<jobTitle()>'
        email: '<email()>'
In TolerantFixtureDenormalizer.php line 62:

  An error occurred while denormalizing the fixture "vendor_user_{1..15}" (App\Entity\User\VendorUser): Could not parse the token "@self->organization->tenant" (type: PROPERTY_REFERENCE_TYPE).


In ExpressionLanguageExceptionFactory.php line 47:

  Could not parse the token "@self->organization->tenant" (type: PROPERTY_REFERENCE_TYPE).


hautelook:fixtures:load [-b|--bundle [BUNDLE]] [--no-bundles] [-m|--manager MANAGER] [--append] [--shard SHARD] [--purge-with-truncate]
WedgeSama pushed a commit to WedgeSama/alice that referenced this issue Feb 8, 2023
I thinks the right syntaxe must be something like `@self->created_by->info->created`, but like said it nelmio#1116 and refered in nelmio#1019, it does not work for now. Using this syntax `@self->created_by.info.created`, it works.
theofidry pushed a commit that referenced this issue Feb 11, 2023
I thinks the right syntaxe must be something like `@self->created_by->info->created`, but like said it #1116 and refered in #1019, it does not work for now. Using this syntax `@self->created_by.info.created`, it works.

Co-authored-by: Benjamin Georgeault <benjamin@drosalys.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants