Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
mysqliresult.php
1<?php
2namespace Bitrix\Main\DB;
3
4class MysqliResult extends Result
5{
7 protected $resource;
8
10 private $resultFields = null;
11
17 public function __construct($result, Connection $dbConnection = null, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery = null)
18 {
19 parent::__construct($result, $dbConnection, $trackerQuery);
20 }
21
27 public function getSelectedRowsCount()
28 {
29 return $this->resource->num_rows;
30 }
31
37 public function getFields()
38 {
39 if ($this->resultFields == null)
40 {
41 $this->resultFields = array();
42 if (is_object($this->resource))
43 {
44 $fields = $this->resource->fetch_fields();
45 if ($fields && $this->connection)
46 {
47 $helper = $this->connection->getSqlHelper();
48 foreach ($fields as $field)
49 {
50 $this->resultFields[$field->name] = $helper->getFieldByColumnType($field->name, $field->type);
51 }
52 }
53 }
54 }
55
56 return $this->resultFields;
57 }
58
64 protected function fetchRowInternal()
65 {
66 return $this->resource->fetch_assoc();
67 }
68}
__construct($result, Connection $dbConnection=null, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery=null)