- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/conversion/leadconverter.php
- Класс: Bitrix\Crm\Conversion\LeadConverter
- Вызов: LeadConverter::initialize
public function initialize()
{
if(!self::checkReadPermission(\CCrmOwnerType::LeadName, $this->entityID))
{
throw new EntityConversionException(
\CCrmOwnerType::Lead,
\CCrmOwnerType::Undefined,
EntityConversionException::TARG_SRC,
EntityConversionException::READ_DENIED
);
}
if(!self::checkUpdatePermission(\CCrmOwnerType::LeadName, $this->entityID))
{
throw new EntityConversionException(
\CCrmOwnerType::Lead,
\CCrmOwnerType::Undefined,
EntityConversionException::TARG_SRC,
EntityConversionException::UPDATE_DENIED
);
}
$dbResult = \CCrmLead::GetListEx(
array(),
array('=ID' => $this->entityID, 'CHECK_PERMISSIONS' => 'N'),
false,
false,
array('ID', 'STATUS_ID', 'IS_RETURN_CUSTOMER')
);
$fields = $dbResult->Fetch();
if(!$fields)
{
throw new EntityConversionException(
\CCrmOwnerType::Lead,
\CCrmOwnerType::Undefined,
EntityConversionException::TARG_SRC,
EntityConversionException::NOT_FOUND
);
}
$this->conversionTypeID = LeadConversionType::resolveByEntityFields($fields);
$this->isReturnCustomer = isset($fields['IS_RETURN_CUSTOMER']) &&$fields['IS_RETURN_CUSTOMER'] == 'Y';
$this->determineStartingPhase();
}