• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/internals/eventservice/event/workgroupuserevent.php
  • Класс: BitrixSocialnetworkInternalsEventServiceEventWorkgroupUserEvent
  • Вызов: WorkgroupUserEvent::getNotVisibleGroupIds
private function getNotVisibleGroupIds($relationKeyList): array
{
	[ $added, $changed, $deleted ] = $relationKeyList;

	$oldFields = $this->getOldFields();
	$newFields = $this->getNewFields();

	$filter = static function($relationKey) use ($newFields) {
		return ($newFields[$relationKey]['GROUP_VISIBLE'] === 'N');
	};
	$changedFilter = static function($relationKey) use ($oldFields, $newFields) {
		return (
			$newFields[$relationKey]['GROUP_VISIBLE'] === 'N'
			&& $oldFields[$relationKey]['GROUP_VISIBLE'] === 'N'
		);
	};
	$deletedFilter = static function($relationKey) use ($oldFields) {
		return ($oldFields[$relationKey]['GROUP_VISIBLE'] === 'N');
	};

	$relationKeyList = array_merge(
		array_filter($added, $filter),
		array_filter($changed, $changedFilter),
		array_filter($deleted, $deletedFilter),
	);

	return array_map(static function($relationKey) {
		[ $groupId, ] = explode('_', $relationKey);
		return $groupId;
	}, $relationKeyList);
}