<?php
namespace Claromentis\Core\DAL\MSSQL\Sybase;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_31767d7ad5" . "8e706dbf47b" . "7a51a0fe6c4" => base64_decode("Y2" . "91" . "bn" . "Q="));
use Claromentis\Core\DAL;
use PDO;
class Result_Sybase implements DAL\ResultInterface
{
    
    
    
    
    protected \PDOStatement $res;
    
    
    
    
    protected int $offset = 0;
    
    
    
    
    protected bool $exhausted = false;
    public function __construct(\PDOStatement $_86ef74f7f3d307443185ea37bf1026fc)
    {
        $this->res = $_86ef74f7f3d307443185ea37bf1026fc;
    }
    public function fetchRow()
    {
        if (!$this->exhausted) {
            $_b8cfc2e06d9d1fec1893ea4a054002bf = $this->res->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT);
            if ($_b8cfc2e06d9d1fec1893ea4a054002bf === false) {
                $this->exhausted = true;
                return null;
            } else {
                return DAL\DbUtil::UTF8Fix($_b8cfc2e06d9d1fec1893ea4a054002bf);
            }
        } else {
            return null;
        }
    }
    public function fetchArray()
    {
        if (!$this->exhausted) {
            if ($this->offset > 0) {
                $_b8cfc2e06d9d1fec1893ea4a054002bf = $this->res->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_ABS, $this->offset);
                $this->offset = 0;
            } else {
                $_b8cfc2e06d9d1fec1893ea4a054002bf = $this->res->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
            }
            if ($_b8cfc2e06d9d1fec1893ea4a054002bf === false) {
                $this->exhausted = true;
                return false;
            } else {
                return DAL\DbUtil::UTF8Fix($_b8cfc2e06d9d1fec1893ea4a054002bf);
            }
        } else {
            return false;
        }
    }
    public function numRows()
    {
        
        
        $this->res->closeCursor();
        $this->res->execute();
        $data = $this->res->fetchAll();
        $_f53d35a1a1e233d98d9ce73d92ab3bb1 = $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_31767d7ad58e706dbf47b7a51a0fe6" . "c4"]($data);
        $this->res->closeCursor();
        $this->res->execute();
        return $_f53d35a1a1e233d98d9ce73d92ab3bb1;
    }
    public function free()
    {
        return $this->res->closeCursor();
    }
    
    
    
    
    
    
    public function hasData()
    {
        return $this->numRows() > 0;
    }
    
    
    
    
    
    
    
    public function fetchAllValues()
    {
        return DAL\DbUtil::fetchAllValues($this);
    }
}