Closed RonFire closed 6 years ago
If I understood it right, you want to use the SocialMediaType in the show view? I never tried to do this, but here is something that works for me. Use the sub entity fields.
$showMapper
->add('socialMedia.name')
;
If you need specific fields, check this.
As @ejkun said showMapper works different than the formMapper and there are docs for it too.
Closing.
Environment
Sonata packages
sonata-project/admin-bundle 3.20.1 sonata-project/block-bundle 3.3.2 sonata-project/cache 1.0.7 sonata-project/core-bundle 3.4.0 sonata-project/datagrid-bundle 2.2.1 sonata-project/doctrine-orm-admin-bundle 3.1.6 sonata-project/exporter 1.7.1
Symfony packages
symfony/monolog-bundle v3.1.0 symfony/phpunit-bridge v3.3.6 symfony/polyfill-apcu v1.4.0 symfony/polyfill-intl-icu v1.4.0 symfony/polyfill-mbstring v1.4.0 symfony/polyfill-php56 v1.4.0 symfony/polyfill-php70 v1.4.0 symfony/polyfill-php72 v1.4.0 symfony/polyfill-util v1.4.0 symfony/security-acl v3.0.0 symfony/swiftmailer-bundle v2.6.3 symfony/symfony v3.3.6
PHP version
PHP 7.0.7 (cli) (built: May 27 2016 11:13:44) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
Subject
Hello Sonata Team,
I am currently trying to implement the EntityAuditBundle you mention in your Documentation (https://sonata-project.org/bundles/doctrine-orm-admin/master/doc/reference/audit.html)
Since the comparison builds on the Show Action i therefore wanted to make that work. There i am having a Issue with showing fields which are handled by embedded forms like this:
this SocialMediaType represents an Embeddable.
Another Usecase is with other real Entities used:
Since a description of how to implement these into the configureShowFields function i am quite desperate on how to use these to show the fields which are defined in those FormTypes.
I hope someone is able to help me on this one.
Best regards, Ronald