• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/command/add.php
  • Класс: BitrixRpaCommandAdd
  • Вызов: Add::save
protected function save(): Result
{
	if (Driver::getInstance()->getBitrix24Manager()->isCreateItemRestricted($this->item->getType()->getId()))
	{
		return ((new Result())->addError(new Error(Loc::getMessage('RPA_LIMIT_CREATE_ITEM_ERROR'))));
	}
	if ($this->userId > 0)
	{
		$this->item->setCreatedBy($this->userId);
		//$this->item->setMovedBy($this->userId);
	}
	$this->item->setCreatedTime(new DateTime());
	//$this->item->setMovedTime(new DateTime());

	if (!$this->isCheckFieldsEnabled())
	{
		/** @var PrototypeItem $dataClass */
		$dataClass = $this->item->sysGetEntity()->getDataClass();
		$dataClass::disableUserFieldsCheck();
	}

	return $this->item->save();
}