- Модуль: perfmon
- Путь к файлу: ~/bitrix/modules/perfmon/classes/general/schema.php
- Класс: CPerfomanceSchema
- Вызов: CPerfomanceSchema::addModuleSchema
function addModuleSchema(array $arModuleSchema)
{
foreach ($arModuleSchema as $module_id => $arModuleTables)
{
if (!array_key_exists($module_id, $this->data_relations))
{
$this->data_relations[$module_id] = array();
}
foreach ($arModuleTables as $parent_table_name => $arParentColumns)
{
if (!array_key_exists($parent_table_name, $this->data_relations[$module_id]))
{
$this->data_relations[$module_id][$parent_table_name] = array();
}
foreach ($arParentColumns as $parent_column => $arChildren)
{
if ($parent_column === '~actions')
{
if (!array_key_exists($module_id, $this->data_actions))
{
$this->data_actions[$module_id] = array();
}
if (!array_key_exists($parent_table_name, $this->data_actions[$module_id]))
{
$this->data_actions[$module_id][$parent_table_name] = array();
}
$this->data_actions[$module_id][$parent_table_name] = array_merge(
$this->data_actions[$module_id][$parent_table_name],
$arChildren
);
}
else
{
if (!array_key_exists($parent_column, $this->data_relations[$module_id][$parent_table_name]))
{
$this->data_relations[$module_id][$parent_table_name][$parent_column] = array();
}
foreach ($arChildren as $child_table_name => $child_column)
{
if (preg_match("#^~(.+)$#", $child_table_name, $m))
{
$this->data_attributes[$module_id][$parent_table_name][$parent_column][$m[1]] = $child_column;
}
else
{
$this->data_relations[$module_id][$parent_table_name][$parent_column][$child_table_name] = $child_column;
}
}
}
}
}
}
}