Sorry about the title - I really don't know how to call this - here is the story:
I have integrated doctrine/orm into Joomla3 as a library and I have created a component based on entities and repositories. It is really neat! I have actually created an J! installable library called JDoctrine which has a single entry point for obtaining the EntityManager. Something like:
require_once JPATH_ROOT."/libraries/jdoctrine/jdoctrine.php";
$JDO = new \stdClass();
$JDO->configuration = new \stdClass();
$JDO->configuration->type = "annotation";
$JDO->configuration->paths = [JPATH_ROOT."/administrator/components/com_something/Core/Entity"];
$JDO->configuration->isDevMode = false;
$JDO->connection = null;
$JDO->eventManager = null;
$em = \JDoctrine::getEntityManager($JDO);
It picks up Joomla's db configuration and table prefix and you can work with entities.
I'd like to distribute this library - maybe someone else finds it useful - but there is one thing I cannot figure out.
If I do this (which is what i want to have in my component install script):
$schemaTool = new SchemaTool($em);
$sqlArray = $schemaTool->getUpdateSchemaSql($classes, false);
I end up with an array of sql statements which will create/update all entities passed in $classes and DROP ALL OTHER TABLES.
For now, for my component for home-use, i fixed this with some really ugly cleanup method keeping only statements having table names that are associated with my entities.
What I'd like to do is to "instruct" doctrine to ignore all tables it does not know of - that is - skip everything there is no entity associated with. Any ideas?