EntityMergerException::getLocalizedMessage

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityMergerException
  4. getLocalizedMessage
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/merger/entitymergerexception.php
  • Класс: Bitrix\Crm\Merger\EntityMergerException
  • Вызов: EntityMergerException::getLocalizedMessage
public function getLocalizedMessage()
{
	switch($this->getCode())
	{
		case self::CONFLICT_RESOLUTION_NOT_SUPPORTED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_CONFLICT_RESOLUTION_NOT_SUPPORTED',
				array('#RESOLUTION_CAPTION#' => ConflictResolutionMode::getCaption($this->conflictResolutionMode))
			);
		case self::CONFLICT_OCCURRED:
			return Main\Localization\Loc::getMessage('CRM_ENTITY_MERGER_EXCEPTION_CONFLICT_OCCURRED');
		case self::READ_DENIED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_READ_DENIED',
				array(
					'#ID#' => $this->getEntityID(),
					'#TITLE#' => \CCrmOwnerType::GetCaption($this->getEntityTypeID(), $this->getEntityID())
				)
			);
		case self::UPDATE_DENIED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_UPDATE_DENIED',
				array(
					'#ID#' => $this->getEntityID(),
					'#TITLE#' => \CCrmOwnerType::GetCaption($this->getEntityTypeID(), $this->getEntityID())
				)
			);
		case self::DELETE_DENIED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_DELETE_DENIED',
				array(
					'#ID#' => $this->getEntityID(),
					'#TITLE#' => \CCrmOwnerType::GetCaption($this->getEntityTypeID(), $this->getEntityID())
				)
			);
		case self::NOT_FOUND:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_NOT_FOUND',
				array('#ID#' => $this->getEntityID())
			);
		case self::UPDATE_FAILED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_UPDATE_FAILED',
				array(
					'#ID#' => $this->getEntityID(),
					'#TITLE#' => \CCrmOwnerType::GetCaption($this->getEntityTypeID(), $this->getEntityID())
				)
			);
		case self::DELETE_FAILED:
			return Main\Localization\Loc::getMessage(
				'CRM_ENTITY_MERGER_EXCEPTION_DELETE_FAILED',
				array(
					'#ID#' => $this->getEntityID(),
					'#TITLE#' => \CCrmOwnerType::GetCaption($this->getEntityTypeID(), $this->getEntityID())
				)
			);
	}

	return Main\Localization\Loc::getMessage(
		'CRM_ENTITY_MERGER_EXCEPTION_ERROR',
		array('#ERROR#' => $this->getMessage())
	);
}

Добавить комментарий