<?php

namespace CGClientTickets\Repository;

abstract class CMSMSBaseRepository extends BaseRepository
{
    abstract function execute();
    abstract public function TotalMatches();

    public function __get($key)
    {
        if( $key == 'fields' ) {
            if( !$this->_rs ) $this->execute();
            return $this->_rs->fields;
        }
        else if( $key == 'EOF' ) {
            return $this->EOF();
        }
    }

    public function RecordCount()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->RecordCount();
    }

    public function MoveNext()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->MoveNext();
    }

    public function MoveFirst()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->MoveFirst();
    }

    public function Rewind()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->MoveFirst();
    }

    public function MoveLast()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->MoveLast();
    }

    public function EOF()
    {
        if( !$this->_rs ) $this->execute();
        return $this->_rs->EOF();
    }

} // end of class

?>
