public function getFromDca()
{
$return = array();
$processed = array();
/** @var SplFileInfo[] $files */
$files = \System::getContainer()->get('contao.resource_finder')->findIn('dca')->depth(0)->files()->name('*.php');
foreach ($files as $file) {
if (in_array($file->getBasename(), $processed)) {
continue;
}
$processed[] = $file->getBasename();
$strTable = $file->getBasename('.php');
$objExtract = \DcaExtractor::getInstance($strTable);
if ($objExtract->isDbTable()) {
$return[$strTable] = $objExtract->getDbInstallerArray();
}
}
ksort($return);
// HOOK: allow third-party developers to modify the array (see #6425)
if (isset($GLOBALS['TL_HOOKS']['sqlGetFromDca']) && is_array($GLOBALS['TL_HOOKS']['sqlGetFromDca'])) {
foreach ($GLOBALS['TL_HOOKS']['sqlGetFromDca'] as $callback) {
$this->import($callback[0]);
$return = $this->{$callback[0]}->{$callback[1]}($return);
}
}
return $return;
}