Description
I'm currently doing some performance improvements in my application. There is one place where I tried to do the following change:
- $this->mediaRepository->find($id)
+ $this->entityManager->getReference(App\Entity\Media::class, new Uuid($id))
But now when it tries to resolve the file location it crashes with File "entity/607513d81ba164604ee80eceebdf5eef7e9172ea/file/..." in filesystem "default" does not exist.
.
It happens because the DefaultFileLocationResolver uses the SHA-1 hash of the entity FQCN as described in https://rekalogika.dev/file-bundle/advanced/entity-association-internal
But when we use a Doctrine Reference we get a proxy object instead and the FQCN is Proxies\__CG__\App\Entity\Media
instead of App\Entity\Media
.
The real class name can be easily resolved via Doctrine\Common\Util\ClassUtils::getRealClass($object::class);
, and if I use that at
I just wanted to ask if this is something you would like to support inside the library itself or if I should just create an own FileLocationResolver?