1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
result.php
См. документацию.
1<?php
2
4
6{
8 private $entity = null;
9
10 private $fields = array();
11 private $resultKeys = array();
12 private $erasedKeys = array();
13
14 public function __construct($entity, $result = null)
15 {
16 parent::__construct($result);
17
18 $this->entity = new $entity;
19
20 $this->resultKeys = array();
21
22 $this->fields = $this->entity->getCachedFieldList();
23 if (!empty($this->fields))
24 $this->resultKeys = array_fill_keys($this->fields, true);
25 }
26
27 public function setResult($result)
28 {
29 parent::__construct($result);
30 }
31
32 public function prepareSelect(array $select)
33 {
34 $this->erasedKeys = array();
35 if (
36 empty($select)
37 || (is_string($select) && $select == '*')
38 || (is_array($select) && in_array('*', $select))
39 )
40 return $select;
41 foreach ($this->fields as $field)
42 {
43 $index = array_search($field, $select);
44 if ($index !== false)
45 continue;
46
47 $select[] = $field;
48 $this->erasedKeys[$field] = true;
49 }
50 unset($index, $field);
51
52 return $select;
53 }
54
55 public function Fetch()
56 {
57 $row = parent::Fetch();
58
59 if (!isset($this) || !is_object($this))
60 return $row;
61
62 if (empty($row))
63 {
64 $this->erasedKeys = array();
65 return $row;
66 }
67
68 if (empty($this->fields))
69 return $row;
70
71 if (isset($row['ID']))
72 {
73 $this->entity->setCacheItem($row['ID'], $row);
74 if (!empty($this->erasedKeys))
75 $row = array_diff_key($row, $this->erasedKeys);
76 }
77
78 return $row;
79 }
80}
$result
Определения dbresult.php:16
Определения result.php:6
setResult($result)
Определения result.php:27
Fetch()
Определения result.php:55
prepareSelect(array $select)
Определения result.php:32
__construct($entity, $result=null)
Определения result.php:14
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$select
Определения iblock_catalog_list.php:194