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

$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_31767d7ad58e706dbf47b7" . "a51a0fe6c4" => base64_decode("Y29" . "1bn" . "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["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_31767d7ad58e7" . "06dbf47b7a51a0" . "fe6c4"]($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);
    }
}