Document::prepareFieldsAdd

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. Document
  4. prepareFieldsAdd
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/document.php
  • Класс: BitrixCatalogControllerDocument
  • Вызов: Document::prepareFieldsAdd
private function prepareFieldsAdd($fields)
{
	if (!array_key_exists('SITE_ID', $fields))
	{
		if (defined('SITE_ID'))
		{
			$fields['SITE_ID'] = SITE_ID;
		}
		else
		{
			$fields['SITE_ID'] = 's1';
		}
	}

	if (!CurrentUser::get()->isAdmin() || !array_key_exists('CREATED_BY', $fields))
	{
		$fields['CREATED_BY'] = CurrentUser::get()->getId();
	}

	if (!CurrentUser::get()->isAdmin() || !array_key_exists('MODIFIED_BY', $fields))
	{
		$fields['MODIFIED_BY'] = CurrentUser::get()->getId();
	}

	return $fields;
}

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