1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
dbresult.php
См. документацию.
1<?php
2
9
10class CDBResult extends CAllDBResult
11{
12 protected $byteaFields = false;
13
14 protected function FetchRow()
15 {
16 if ($this->result)
17 {
18 $result = pg_fetch_assoc($this->result);
19 if ($result)
20 {
21 if ($this->byteaFields === false)
22 {
23 $this->byteaFields = [];
24 $fieldNum = 0;
25 foreach ($result as $fieldName => $_)
26 {
27 $fieldType = pg_field_type($this->result, $fieldNum);
28 if ($fieldType === 'bytea')
29 {
30 $this->byteaFields[$fieldName] = $fieldType;
31 }
32 $fieldNum++;
33 }
34 }
35
36 if ($this->byteaFields)
37 {
38 foreach ($this->byteaFields as $fieldName => $fieldType)
39 {
40 $result[$fieldName] = pg_unescape_bytea($result[$fieldName]);
41 }
42 }
43
44 return array_change_key_case($result, CASE_UPPER);
45 }
46 }
47 return false;
48 }
49
50 public function SelectedRowsCount()
51 {
52 return ($this->result ? pg_num_rows($this->result) : 0);
53 }
54
55 public function AffectedRowsCount()
56 {
57 return pg_affected_rows($this->result);
58 }
59
60 public function FieldsCount()
61 {
62 return pg_num_fields($this->result);
63 }
64
65 public function FieldName($iCol)
66 {
67 return mb_strtoupper(pg_field_name($this->result, $iCol));
68 }
69
70 protected function GetRowsCount(): ?int
71 {
72 if ($this->result)
73 {
74 return pg_num_rows($this->result);
75 }
76
77 return null;
78 }
79
80 protected function Seek(int $offset): void
81 {
82 pg_result_seek($this->result, $offset);
83 }
84}
Определения dbresult.php:15
$result
Определения dbresult.php:16
Seek(int $offset)
Определения dbresult.php:80
AffectedRowsCount()
Определения dbresult.php:55
FieldName($iCol)
Определения dbresult.php:65
SelectedRowsCount()
Определения dbresult.php:50
$byteaFields
Определения dbresult.php:12
GetRowsCount()
Определения dbresult.php:70
FetchRow()
Определения dbresult.php:14
FieldsCount()
Определения dbresult.php:60