1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
checkexists.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\Controller;
4
5use Bitrix\Main\Result;
6
8{
9 abstract protected function getEntityTable();
10
11 protected function isExistsRow(int $id): bool
12 {
13 $entityTable = $this->getEntityTable();
14
15 $row = $entityTable::getRow([
16 'select' => [
17 'ID',
18 ],
19 'filter' => [
20 '=ID' => $id,
21 ],
22 ]);
23
24 return !empty($row);
25 }
26
30 protected function exists($id)
31 {
32 $result = new Result();
33
34 if (!$this->isExistsRow($id))
35 {
36 $result->addError($this->getErrorEntityNotExists());
37 }
38
39 return $result;
40 }
41}
$result
Определения get_property_values.php:14
exists($id)
Определения checkexists.php:30
trait CheckExists
Определения checkexists.php:8
isExistsRow(int $id)
Определения checkexists.php:11