- Модуль: webdav
- Путь к файлу: ~/bitrix/modules/webdav/classes/iblock.php
- Класс: CWebDavIblock
- Вызов: CWebDavIblock::IsTrashEmpty
function IsTrashEmpty()
{
static $dataType = 'TrashEmpty';
$trashEmpty = $this->_dataCache($dataType);
if ($trashEmpty === false)
{
$trashEmpty = 'Y';
$trashSectionID = $this->GetMetaID('TRASH');
$cnt = CIBlockElement::GetList(
Array("ID"=>"DESC"),
$arFilter=Array("SHOW_HISTORY"=>"Y", "IBLOCK_ID"=>$this->IBLOCK_ID, "SECTION_ID"=>$trashSectionID),
array(),
false,
array('ID')
);
if ($cnt > 0)
{
$trashEmpty = 'N';
}
else
{
$dbTrash = CIBlockSection::GetList(Array("ID"=>"DESC"), $arFilter=Array("SHOW_HISTORY"=>"Y", "IBLOCK_ID"=>$this->IBLOCK_ID, "SECTION_ID"=>$trashSectionID), false, array("ID"));
if ($dbTrash && $arTrashItem = $dbTrash->Fetch())
{
$trashEmpty = 'N';
}
}
$this->_dataCache($dataType, $trashEmpty);
}
return ($trashEmpty==='Y');
}