31 $this->_moduleTableMap = $tables;
47 if (
'db_schema' != $fileType || !preg_match(
'#.*/db_schema\.xml$#', $file)) {
51 $dependenciesInfo = [];
54 $dom = new \DOMDocument();
56 $tables = $dom->getElementsByTagName(
'table');
57 $constraints = $dom->getElementsByTagName(
'constraint');
60 $foreignKeyTables = [];
61 $foreignKeyReferenceTables = [];
64 foreach ($tables as
$table) {
65 $tableNames[] =
$table->getAttribute(
'name');
71 if (strtolower($xsiType) ==
'foreign' &&
$constraint->getAttribute(
'disabled') !==
'1') {
72 $foreignKeyTables[] =
$constraint->getAttribute(
'table');
73 $foreignKeyReferenceTables[] =
$constraint->getAttribute(
'referenceTable');
77 $tableNames = array_unique(array_merge($tableNames, $foreignKeyReferenceTables, $foreignKeyTables));
80 foreach ($tableNames as
$table) {
81 if (!isset($this->_moduleTableMap[
$table])) {
85 if (strtolower($currentModule) !== strtolower($this->_moduleTableMap[
$table])) {
86 $dependenciesInfo[] = [
87 'module' => $this->_moduleTableMap[
$table],
94 foreach ($unKnowTables as $tables) {
95 foreach ($tables as
$table) {
96 $dependenciesInfo[] = [
'module' =>
'Unknown',
'source' =>
$table];
99 return $dependenciesInfo;
__construct(array $tables)
getDependencyInfo($currentModule, $fileType, $file, &$contents)