articlesSections(); $AA = []; $SQL = sqlQuery('SELECT id, nick FROM '.getTableName('articles_authors').' ORDER BY nick ASC'); foreach ($SQL as $key => $row) { $AA[$key]['id'] = $row['id']; $AA[$key]['nick'] = $row['nick']; } return array_merge($vars, [ 'article_sec' => $AS, 'article_aut' => $AA, ]); } public function articlesSections($topCat = null) { $data = []; $SQL = sqlQueryBuilder()->select('ab.id, ab.name') ->from('articles_branches', 'ab') ->where(Operator::equalsNullable(['ab.top_branch' => $topCat])) ->orderBy('ab.name', 'ASC') ->execute(); foreach ($SQL as $key => $row) { $data[$key]['id'] = $row['id']; $data[$key]['topCat'] = $row['id']; $data[$key]['title'] = $row['name']; $data[$key]['submenu'] = $this->articlesSections($data[$key]['topCat']); } return $data; } } return ArticlesMenu::class;