Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
oracleresult.php
1<?php
2namespace Bitrix\Main\DB;
3
4class OracleResult extends Result
5{
7 private $resultFields = null;
8
14 public function __construct($result, Connection $dbConnection = null, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery = null)
15 {
16 parent::__construct($result, $dbConnection, $trackerQuery);
17 }
18
24 public function getSelectedRowsCount()
25 {
26 return oci_num_rows($this->resource);
27 }
28
34 public function getFields()
35 {
36 if ($this->resultFields == null)
37 {
38 $this->resultFields = array();
39 if (is_resource($this->resource))
40 {
41 $numFields = oci_num_fields($this->resource);
42 if ($numFields > 0 && $this->connection)
43 {
44 $helper = $this->connection->getSqlHelper();
45 for ($i = 1; $i <= $numFields; $i++)
46 {
47 $name = oci_field_name($this->resource, $i);
48 $type = oci_field_type($this->resource, $i);
49 $parameters = array(
50 "precision" => oci_field_precision($this->resource, $i),
51 "scale" => oci_field_scale($this->resource, $i),
52 "size" => oci_field_size($this->resource, $i),
53 );
54
55 $this->resultFields[$name] = $helper->getFieldByColumnType($name, $type, $parameters);
56 }
57 }
58 }
59 }
60
61 return $this->resultFields;
62 }
63
69 protected function fetchRowInternal()
70 {
71 return oci_fetch_array($this->resource, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS);
72 }
73}
__construct($result, Connection $dbConnection=null, \Bitrix\Main\Diag\SqlTrackerQuery $trackerQuery=null)