• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/binding/entitybinding.php
  • Класс: Bitrix\Crm\Binding\EntityBinding
  • Вызов: EntityBinding::prepareEntityBindings
static function prepareEntityBindings($entityTypeID, array $entityIDs)
{
	if(!is_int($entityTypeID))
	{
		$entityTypeID = (int)$entityTypeID;
	}

	self::validateEntityTypeId($entityTypeID);

	$fieldName = self::resolveEntityFieldName($entityTypeID);

	$bindings = array();
	$entityIDs = array_filter($entityIDs);
	$sort = 0;
	foreach($entityIDs as $entityID)
	{
		if($entityID > 0)
		{
			$sort += 10;
			$bindings[] = array($fieldName => (int)$entityID, 'SORT' => $sort);
		}
	}
	return $bindings;
}