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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_c06c961f" . "393742ecf" . "d52b72263" . "ac9470" => base64_decode("aW" . "50" . "dm" . "Fs"), "_9a1d01ea56101db475f6" . "e198f06a4f9d" => base64_decode("c3Fsc3J2X2ZyZWVfc3RtdA=" . "="), "_4ffb18fb6d" . "635e72f8c4f" . "2f7b088bfe5" => base64_decode("c3Fsc3J" . "2X251bV" . "9yb3dz"), "_78aadcc2e8dfece" . "f37e1fe6d5ffbcdb" . "b" => base64_decode("c3Fsc3J2X2ZldG" . "NoX2FycmF5"));
use Claromentis\Core\DAL;




class ResultClientBuffered implements DAL\ResultInterface
{
    protected $first;
    protected $cur_row;
    protected $stmt;
    public function __construct($_a606a2dcd236a549db0574a9c1675927, $_0e1e1540aa50c90f8f93a604b129857d = 0)
    {
        $this->first = $_0e1e1540aa50c90f8f93a604b129857d < 0 ? 0 : $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_c06c961f393742ecfd52b7" . "2263ac9470"]($_0e1e1540aa50c90f8f93a604b129857d);
        $this->cur_row = 0;
        $this->stmt = $_a606a2dcd236a549db0574a9c1675927;
        if ($_a606a2dcd236a549db0574a9c1675927 === true) {
            return;
        }
    }
    public function fetchRow()
    {
        $data = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_78aadcc2e8dfe" . "cef37e1fe6d5ff" . "bcdbb"]($this->stmt, SQLSRV_FETCH_NUMERIC, SQLSRV_SCROLL_ABSOLUTE, $this->first + $this->cur_row++);
        
        
        return $data;
    }
    public function fetchArray()
    {
        $data = $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_78aadcc2e8dfecef3" . "7e1fe6d5ffbcdbb"]($this->stmt, SQLSRV_FETCH_ASSOC, SQLSRV_SCROLL_ABSOLUTE, $this->first + $this->cur_row++);
        
        
        return $data;
    }
    public function numRows()
    {
        $_6d60734c2a1ffa4412b7c7bea8ad3bac = $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_4ffb18fb6d" . "635e72f8c4f" . "2f7b088bfe5"]($this->stmt);
        
        
        return $_6d60734c2a1ffa4412b7c7bea8ad3bac > $this->first ? $_6d60734c2a1ffa4412b7c7bea8ad3bac - $this->first : 0;
    }
    public function hasData()
    {
        
        
        
        return $this->numRows() > 0;
    }
    public function free()
    {
        if ($this->stmt) {
            $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_9a1d01e" . "a56101db" . "475f6e19" . "8f06a4f9" . "d"]($this->stmt);
            $this->stmt = null;
        }
        return true;
    }
    
    
    
    
    
    
    
    public function fetchAllValues()
    {
        return DAL\DbUtil::fetchAllValues($this);
    }
    public function __destruct()
    {
        $this->free();
    }
}