I have a two level entity folder in a Symfony2 bundle:
CommonBundle/Entity/EntityFolder1/EntityA.php
CommonBundle/Entity/EntityFolder2
CommonBundle/Entity/EntityFolder3
CommonBundle/Entity/EntityFolder4
When I try to get the repositories for an entity that is within one of the folders:
$product = $this->getDoctrine()->getRepository('CommonBundle:EntityA')->find(1);
Symfony doesn't recognize this CommonBundle:EntityA
.
I also tried with CommonBundle:EntityFolder1:EntityA
.
Warning: class_parents(): Class CommonBundle\Entity\EntityA does not exist and could not be loaded in
It's CommonBundle:EntityFolder1\EntityA
.
Use the full class name of your entity:
$product = $this->getDoctrine()
->getRepository('Acme\CommonBundle\Entity\EntityFolder1\EntityA')
->find(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With