ProductPropertyEnum::deleteAction

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. ProductPropertyEnum
  4. deleteAction
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/controller/productpropertyenum.php
  • Класс: BitrixCatalogControllerProductPropertyEnum
  • Вызов: ProductPropertyEnum::deleteAction
public function deleteAction(int $id): ?bool
{
	$existsResult = $this->exists($id);
	if (!$existsResult->isSuccess())
	{
		$this->addErrors($existsResult->getErrors());
		return null;
	}

	$propertyId = $this->get($id)['PROPERTY_ID'];
	$deleteResult = PropertyEnumerationTable::delete([
		'ID' => $id,
		'PROPERTY_ID' => $propertyId,
	]);

	if (!$deleteResult)
	{
		$this->addErrors($deleteResult->getErrors());
		return null;
	}

	return $deleteResult->isSuccess();
}

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