Workgroup::getTypeCodeByParams

  1. Bitrix24 API (v. 23.675.0)
  2. socialnetwork
  3. Workgroup
  4. getTypeCodeByParams
  • Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/helper/workgroup.php
  • Класс: Bitrix\Socialnetwork\Helper\Workgroup
  • Вызов: Workgroup::getTypeCodeByParams
static function getTypeCodeByParams($params)
{
	$result = false;

	if (empty($params['fields']))
	{
		return $result;
	}

	$typesList = (
		!empty($params['typesList'])
			? $params['typesList']
			: self::getTypes($params)
	);

	foreach ($typesList as $code => $type)
	{
		if (
			(
				!isset($params['fields']['OPENED'])
				|| $params['fields']['OPENED'] === $type['OPENED']
			)
			&& (
				!isset($params['fields']['VISIBLE'])
				|| $params['fields']['VISIBLE'] === $type['VISIBLE']
			)
			&& $params['fields']['PROJECT'] === $type['PROJECT']
			&& $params['fields']['EXTERNAL'] === $type['EXTERNAL']
			&& (
				!isset($params['fields']['SCRUM_PROJECT'])
				|| (
					isset($type['SCRUM_PROJECT'])
					&& $params['fields']['SCRUM_PROJECT'] === $type['SCRUM_PROJECT']
				)
			)
		)
		{
			$result = $code;
			break;
		}
	}

	return $result;
}

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