goodwix / doctrine-json-odm Goto Github PK
View Code? Open in Web Editor NEWJSON Object-Document Mapping bundle for Symfony and Doctrine
License: MIT License
JSON Object-Document Mapping bundle for Symfony and Doctrine
License: MIT License
Adopting this code:
require_once __DIR__.'/../vendor/autoload.php';
use Goodwix\DoctrineJsonOdm\Type\ODMType;
use Symfony\Component\Serializer\SerializerInterface;
class Document { }
ODMType::registerODMType(
Document::class,
new class implements SerializerInterface
{
public function serialize($data, $format, array $context = []) { /* Implement serialize() method. */ }
public function deserialize($data, $type, $format, array $context = []) { /* Implement deserialize() method. */ }
}
);
After install scripts to add bundle to Symfony Kernel
See #18
Hello,
After installaton I don't know why but at doctrine flush time in test, ODMType trigger serializer => Serializer trigger Api Platform => Api Platform trigger router.
Or even, it seems that multi kernel are booted ? But nothing before with dunglas json_document
...
3) MyApp\Apps\Core\Tests\Functional\ItemSearchByContainerTest::testWeCouldFindUserItemInAContainer
Symfony\Component\Config\Exception\LoaderLoadException: Cannot load resource "kernel::loadRoutes". Make sure there is a loader supporting the "service" type.
/var/www/html/apps/core/vendor/symfony/config/Loader/DelegatingLoader.php:37
/var/www/html/apps/core/vendor/symfony/framework-bundle/Routing/DelegatingLoader.php:70
/var/www/html/apps/core/vendor/symfony/framework-bundle/Routing/Router.php:68
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/Router.php:68
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/RouteNameResolver.php:48
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php:47
/var/www/html/apps/core/vendor/api-platform/core/src/Cache/CachedTrait.php:44
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php:48
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/IriConverter.php:148
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/IriConverter.php:128
/var/www/html/apps/core/vendor/api-platform/core/src/Serializer/AbstractItemNormalizer.php:149
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:161
/var/www/html/apps/core/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:231
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:161
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:134
/var/www/html/apps/core/vendor/goodwix/doctrine-json-odm/src/Type/ODMType.php:114
/var/www/html/apps/core/vendor/doctrine/dbal/src/Statement.php:109
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php:155
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1120
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:415
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:388
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/EntityManager_9a5be93.php:136
/var/www/html/apps/core/tests/Functional/ItemSearchByContainerTest.php:40
1) MyApp\Apps\Core\Tests\Smoke\ApiResourcesPermissionsTest::testOperationLeadCanOnlySeeUnloadingTasksThatMatchTheirZonesOrRelatedPickupTaskZone
**Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The "kernel" service is synthetic, it needs to be set at boot time before it can be used.**
/var/www/html/apps/core/vendor/symfony/dependency-injection/Container.php:232
/var/www/html/apps/core/vendor/symfony/dependency-injection/Container.php:197
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/getRouting_Loader_XmlService.php:31
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/App_KernelTestDebugContainer.php:629
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/getRouting_ResolverService.php:25
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/App_KernelTestDebugContainer.php:629
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/getRouting_LoaderService.php:25
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/App_KernelTestDebugContainer.php:629
/var/www/html/apps/core/vendor/symfony/dependency-injection/Container.php:383
/var/www/html/apps/core/vendor/symfony/dependency-injection/Argument/ServiceLocator.php:40
/var/www/html/apps/core/vendor/symfony/framework-bundle/Routing/Router.php:68
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/Router.php:68
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/RouteNameResolver.php:48
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php:47
/var/www/html/apps/core/vendor/api-platform/core/src/Cache/CachedTrait.php:44
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/CachedRouteNameResolver.php:48
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/IriConverter.php:148
/var/www/html/apps/core/vendor/api-platform/core/src/Bridge/Symfony/Routing/IriConverter.php:128
/var/www/html/apps/core/vendor/api-platform/core/src/Serializer/AbstractItemNormalizer.php:149
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:161
/var/www/html/apps/core/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:231
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:161
/var/www/html/apps/core/vendor/symfony/serializer/Serializer.php:134
/var/www/html/apps/core/vendor/goodwix/doctrine-json-odm/src/Type/ODMType.php:114
/var/www/html/apps/core/vendor/doctrine/dbal/src/Statement.php:109
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php:155
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1120
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:415
/var/www/html/apps/core/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:388
/var/www/html/apps/core/var/cache/test/ContainerSV7NsKi/EntityManager_9a5be93.php:136
/var/www/html/apps/core/tests/Smoke/ApiResourcesPermissionsTest.php:101
Auto registrar uses Doctrine Annotation reader while registering odm types. For performance optimization it is usesful to cache ODM annotation options.
Hello,
Thanks for your works.
I search a way to type with an abstract, but at deserialization time, it doesn't know the concrete "real" type of the stored object. So it says to me "Impossible to create instance of an abstract", logic, as it is an abstract :D
Is their a way to distinct the real type between each children instance at serialization ?
Maybe this way : Symfony serializer : discriminator
I will make a try and do a test with that, or document that....
See you :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.