removed loop, added direct paths

This commit is contained in:
Michael Heiniger 2013-03-13 10:45:22 +01:00
commit ed71a9f1be

View file

@ -62,19 +62,18 @@ abstract class AbstractDataHandler
$this->dbMap = Propel::getDatabaseMap($connectionName);
if (0 === count($this->dbMap->getTables())) {
foreach (array('src', 'vendor') as $path) {
$finder = new Finder();
$files = $finder->files()->name('*TableMap.php')
->in($this->getRootDir() . '/../' . $path)
->exclude('PropelBundle')
->exclude('Tests');
$finder = new Finder();
$files = $finder->files()->name('*TableMap.php')
->in($this->getRootDir() . '/../src/')
->in($this->getRootDir() . '/../vendor/')
->exclude('PropelBundle')
->exclude('Tests');
foreach ($files as $file) {
$class = $this->guessFullClassName($file->getRelativePath(), basename($file, '.php'));
foreach ($files as $file) {
$class = $this->guessFullClassName($file->getRelativePath(), basename($file, '.php'));
if (null !== $class) {
$this->dbMap->addTableFromMapClass($class);
}
if (null !== $class && $this->isInDatabase($class, $connectionName)) {
$this->dbMap->addTableFromMapClass($class);
}
}
}