• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/kanban/supervisor.php
  • Класс: Bitrix\Crm\Kanban\SupervisorTable
  • Вызов: SupervisorTable::set
static function set($type, $set)
{
	if ($type = \CCrmOwnerType::ResolveID($type))
	{
		$uid = \CCrmSecurityHelper::GetCurrentUserID();
		$exist = self::getList(array('filter' => array(
			'ENTITY_TYPE_ID' => $type,
			'USER_ID' => $uid
		)))->fetch();
		if ($set && !$exist)
		{
			self::add(array(
				'ENTITY_TYPE_ID' => $type,
				'USER_ID' => $uid
			));
		}
		elseif (!$set && $exist)
		{
			self::delete($exist['ID']);
		}
	}
}