Mapper::deleteByFilter

  1. Bitrix24 API (v. 23.675.0)
  2. calendar
  3. Mapper
  4. deleteByFilter
  • Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/core/mappers/mapper.php
  • Класс: BitrixCalendarCoreMappersMapper
  • Вызов: Mapper::deleteByFilter
public function deleteByFilter($filter, array $params = ['softDelete' => true]): self
{
	$className = $this->getMapClass();
	$result = new $className();
	$paramsForSelect = [
		'filter' => $filter,
		'select' => ['ID']
	];

	$managerResult = $this->getDataManagerResult($paramsForSelect);
	while ($row = $managerResult->fetchObject())
	{
		if ($this->getCacheMap()->has($row->getId()))
		{
			$this->delete($this->getCacheMap()->getItem($row->getId()), $params);
		}
		else
		{
			// TODO: change to more smarty way. Without build entity object and select database.
			$entity = $this->getById($row->getId());
			$this->delete($entity, $params);
		}
	}

	return $result;
}

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