CCrmRestEventDispatcher::onUserFieldUpdate

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRestEventDispatcher
  4. onUserFieldUpdate
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRestEventDispatcher
  • Вызов: CCrmRestEventDispatcher::onUserFieldUpdate
static function onUserFieldUpdate($fields, $id)
{
	if ($id > 0)
	{
		$id = (int)$id;
		$fields = CUserTypeEntity::GetByID($id);
		if (is_array($fields)
			&& isset($fields['FIELD_NAME']) && is_string($fields['FIELD_NAME']) && $fields['FIELD_NAME'] <> ''
			&& isset($fields['ENTITY_ID']) && static::verifyEntityId($fields['ENTITY_ID']))
		{
			$entityId = $fields['ENTITY_ID'];
			$fieldName = $fields['FIELD_NAME'];

			self::sendEvent(
				'Update',
				[
					'id' => $id,
					'entityId' => $entityId,
					'fieldName' => $fieldName
				],
				[
					'UF_ENTITY_ID' => $entityId,
				],
			);
		}
	}
}

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