Disclaimer: I'm new to Doctrine
I'm currently building a project that requires extreme modularity and flexibility, and have 2 questions related to it. My project considers the following an "ideal" simplified structure:
PackageA
PackageA.php
PackageA.orm.yml
PackageB
PackageB.php
PackageB.orm.yml
PackageC
PackageC.php
PackageC.orm.yml
Because these packages are added or removed fairly frequently, my goal is for each package to define its own mapping for persistence (as shown above). However, the examples of doctrine configuration I've seen, place all the mapping files (xml or yml) into a single directory, in that case my structure would be:
PackageA
PackageA.php
PackageB
PackageB.php
PackageC
PackageC.php
Config
PackageA.orm.yml
PackageB.orm.yml
PackageC.orm.yml
Question 1: Is it possible to keep each mapping configuration file in a different location (like first example), and if so, how do you instantiate an EntityManager with that kind of configuration (I've read the Docs for Setup and can't seem to find this capability).
Question 2: I've seen how to create Schemas using the command line tool, but ideally I would like to each package to create its own schema, so if PackageD is installed onto a system and its schema doesn't exist yet, it is able to create it on the fly. Is that possible with Doctrine?
Note: I've seen some ability for creating schemas on demand with SchemaTool, but it seems limited to create all the schemas, is that true?