• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/mailboxdirectory.php
  • Класс: BitrixMailMailboxDirectory
  • Вызов: MailboxDirectory::fetchAll
static function fetchAll($mailboxId)
{
	$query = MailboxDirectoryTable::getList([
		'filter' => [
			'=MAILBOX_ID' => $mailboxId
		],
		'select' => ['*'],
		/*
			When assembling directories, we look for their parents.
			Sorting ensures that for a directories that parents are processed first,
			and for children, matching parents are always found from those processed.
		 */
		'order'  => ['LEVEL' => 'ASC']
	]);

	$result = [];

	while ($row = $query->fetchObject())
	{
		$result[$row->getPath()] = $row;
	}

	return $result;
}