I have a project in Symfony 3.4 and I am configuring flex, to later go to version 4.4.
I have already managed to modify the project folder structure, and it is trying to map, but the problem is that with the old configuration it does not work.
These are my bundles (I have kept the same structure here):
> SRC
> H360 (the place of my bundles)
> comercialBundle
> jasperBundle
> generalBundle
> ...
And this is my orm config (i tried setting 'generalbundle'):
orm:
default_entity_manager: default
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
connection: default
auto_mapping: true
mappings:
generalBundle:
type: annotation
prefix: 'H360\generalBundle'
dir: '%kernel.project_dir%/src/H360/generalBundle/Entity'
is_bundle: false
translatable:
type: annotation
alias: Gedmo
prefix: Gedmo\Translatable\Entity
# make sure vendor library location is correct
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity"
is_bundle: false
And the error is: "The class 'generalBundle\Entity\GenParametros' was not found in the chain configured namespaces H360\generalBundle, Gedmo\Translatable\Entity"
Any ideas?
My Answer:
It looks like the issue might be with the namespace configuration in your orm config. Try updating the namespace prefix to match the actual namespace of your entities in the generalBundle.
You can also try using the full namespace path in the orm config instead of just the prefix. For example:
yaml
mappings:
generalBundle:
type: annotation
dir: '%kernel.project_dir%/src/H360/generalBundle/Entity'
is_bundle: false
Make sure that the namespace of your entity classes in the generalBundle matches the namespace specified in the orm config. For example, if your entity class is GenParametros, make sure it is in the namespace `H360\generalBundle\Entity`.
After making these changes, try clearing the cache and see if the mapping issue is resolved.
Rate this post
5 of 5 based on 3234 votesComments