• Модуль: catalogmobile
  • Путь к файлу: ~/bitrix/modules/catalogmobile/lib/Controller/StoreDocumentDetails.php
  • Класс: Bitrix\CatalogMobile\Controller\StoreDocumentDetails
  • Вызов: StoreDocumentDetails::loadMainAction
public function loadMainAction(int $entityId = null, string $docType = null): array
{
	if (!$this->checkDocumentReadRights($entityId, $docType))
	{
		$this->addError(new Error(Loc::getMessage('MOBILE_CONTROLLER_CATALOG_DETAILS_ERROR_READ_PERMS')));

		return [];
	}

	if ($entityId === null)
	{
		if (empty($docType))
		{
			throw new \DomainException('Parameter {docType} is required for document creation.');
		}

		$provider = StoreDocumentProvider::createByType($docType);
	}
	else
	{
		$provider = StoreDocumentProvider::createById($entityId);
	}

	return [
		'editor' => (new FormWrapper($provider))->getResult(),
	];
}