Skip to content
Advertisement

Tag: doctrine-orm

Symfony5/Doctrine can’t find my XML mapping file for my entity

I am currently trying to set up from scratch a Symfony 5 project using Doctrine with XML mapping. I created a simple AppBundle with some entities. After trying to generate my migration, I have this error : No mapping file found named ‘User.orm.xml’ for class ‘AppEntityUserUser’. A quick google search tells me it might be a conflict with annotations (which

How to autoload custom annotation classes without using AnnotationRegistry?

I’m using Doctrine Annotations library (not the whole Doctrine, only annotations) and want to make a custom annotation class. composer.json: index.php: entities/MyClass.php annotations/TestAnnotation.php It gives me the following error: The only solution i found on the Internet is to use AnnotationRegistry::registerLoader or something similar, but it is deprecated so i’d like to solve the problem in another way. Answer One

Doctrine – Hydrate collection in Entity class

I have a problem regarding a bi-directional OneToMany <-> ManyToOne relationship between my entities Device and Event. This is how mapping looks: The problem comes because Device is a Single Table Inheritance entity and each time I fetch and iterate over some Event entities, then $device is always eagerly fetched. This happens because it’s a STI entity as reported in

Advertisement