CCrmOwnerType::GetFields

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmOwnerType
  4. GetFields
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_owner_type.php
  • Класс: \CCrmOwnerType
  • Вызов: CCrmOwnerType::GetFields
static function GetFields($typeID, $ID, $options = array())
{
	$typeID = intval($typeID);
	$ID = intval($ID);
	$options = is_array($options) ? $options : array();

	$select = isset($options['SELECT']) ? $options['SELECT'] : array();
	switch($typeID)
	{
		case self::Lead:
		{
			$dbRes = CCrmLead::GetListEx(array(), array('=ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Contact:
		{
			$dbRes = CCrmContact::GetListEx(array(), array('=ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Company:
		{
			$dbRes = CCrmCompany::GetListEx(array(), array('=ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Deal:
		{
			$dbRes = CCrmDeal::GetListEx(array(), array('=ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Invoice:
		{
			$dbRes = CCrmInvoice::GetList(array(), array('ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Quote:
		{
			$dbRes = CCrmQuote::GetList(array(), array('=ID' => $ID), false, false, $select);
			return $dbRes ? $dbRes->Fetch() : null;
		}
		case self::Requisite:
		{
			$requisite = new \Bitrix\Crm\EntityRequisite();
			$dbRes = $requisite->getList(array(
				'filter' => array('=ID' => $ID),
				'select' => $select
			));
			return $dbRes ? $dbRes->fetch() : null;
		}
	}

	return null;
}

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