I am using the Lexik Trnaslation Bundle.
After I ran
./bin/console doctrine:schema:update --force
It added some tables to my database. These tables however don't have any Entities or Repository Classes.
How can I fetch the Data from these tables? Is this even possible with doctrine?
CodePudding user response:
There are entity classes and repository classes mapped to these new tables, or course. Otherwise doctrine:schema:update wouldn't create any tables at all.
If you take a look at the source code of the plugin, you'll see the corresponding classes here.
The repositories are:
FileRepositoryTransUnitRepositoryTranslationRepository
These repositories are not declared as services, so you won't be able to inject them directly. But you can inject the ManagerRegistryInterface and get the repository like this:
// example to get the FileRepository, assuming that $this->manager
// holds the EntityManager
$fileRepository = $this
->manager
->getRepository(Lexik\Bundle\TranslationBundle\Entity\File::class);
