EntityPermsTable::clearByEntity

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityPermsTable
  4. clearByEntity
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitypermstable.php
  • Класс: Bitrix\Crm\EntityPermsTable
  • Вызов: EntityPermsTable::clearByEntity
static function clearByEntity(string $entityName, int $entityId): Result
{
	$filter = [
		'=ENTITY' => $entityName,
		'=ENTITY_ID' => $entityId,
	];

	$entity = static::getEntity();
	$connection = $entity->getConnection();

	return $connection->query(sprintf(
		'DELETE FROM %s WHERE %s',
		$connection->getSqlHelper()->quote($entity->getDbTableName()),
		Query::buildFilterSql($entity, $filter)
	));
}

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