• Модуль: report
  • Путь к файлу: ~/bitrix/modules/report/lib/visualconstructor/controller/widget.php
  • Класс: BitrixReportVisualConstructorControllerWidget
  • Вызов: Widget::checkIsCompatibleWithSelectedViewAction
public function checkIsCompatibleWithSelectedViewAction($params)
{
	if (!isset($params['newViewKey']))
	{
		$this->addError(new Error('new view key not exist'));
		return false;
	}

	if (!isset($params['oldViewKey']))
	{
		$this->addError(new Error('old view key not exist'));
		return false;
	}
	$newView = ViewProvider::getViewByViewKey($params['newViewKey']);
	$oldView = ViewProvider::getViewByViewKey($params['oldViewKey']);

	if (!$newView)
	{
		$this->addError(new Error('view not found with key: ' . $params['newViewKey']));
		return false;
	}

	if (!$oldView)
	{
		$this->addError(new Error('view not found with key: ' . $params['oldViewKey']));
		return false;
	}


	$result = $oldView->isCompatibleWithView($newView);
	return array('isCompatible' => $result);
}