- Модуль: lists
- Путь к файлу: ~/bitrix/modules/lists/lib/entity/element.php
- Класс: BitrixListsEntityElement
- Вызов: Element::isExist
public function isExist()
{
$this->param->checkRequiredInputParams(["IBLOCK_CODE", "IBLOCK_ID", "ELEMENT_CODE", "ELEMENT_ID"]);
if ($this->param->hasErrors())
{
$this->errorCollection->add($this->param->getErrors());
return false;
}
$filter = [
"ID" => $this->params["ELEMENT_ID"] ? $this->params["ELEMENT_ID"] : "",
"IBLOCK_ID" => $this->iblockId,
"=CODE" => $this->params["ELEMENT_CODE"] ? $this->params["ELEMENT_CODE"] : "",
"CHECK_PERMISSIONS" => "N",
];
$queryObject = CIBlockElement::getList([], $filter, false, false, ["ID"]);
return (bool) $queryObject->fetch();
}