protected function fetchResult(Select $select, AbstractResultSet $resultSet = null)
    {
        $resultSet = $resultSet ?: $this->getResultSet();
        $resultSet->buffer();

        if ($this->usePaginator()) {
            $this->setUsePaginator(false);
            $resultSet = $this->paginate($select, $resultSet);
        } else {
            $statement = $this->getSql()->prepareStatementForSqlObject($select);
            $result = $statement->execute();
            $resultSet->initialize($result);
        }

        return $resultSet;
    }
protected function fetchResult(Select $select, AbstractResultSet $resultSet = null)
    {
        $resultSet = $resultSet ?: $this->getResultSet();
        $resultSet->buffer();

        if ($this->usePaginator()) {
            $this->setUsePaginator(false);
            $resultSet = $this->paginate($select, $resultSet);
        } else {
            $statement = $this->getSql()->prepareStatementForSqlObject($select);
            $result = $statement->execute();
            $resultSet->initialize($result);
        }

        return $resultSet;
    }
protected function fetchResult ( Select $ select , AbstractResultSet $ resultSet = null ) { $ resultSet = $ resultSet ? : $ this -> getResultSet ( ) ; $ resultSet -> buffer ( ) ; if ( $ this -> usePaginator ( ) ) { $ this -> setUsePaginator ( false ) ; $ resultSet = $ this -> paginate ( $ select , $ resultSet ) ; } else { $ statement = $ this -> getSql ( ) -> prepareStatementForSqlObject ( $ select ) ; $ result = $ statement -> execute ( ) ; $ resultSet -> initialize ( $ result ) ; } return $ resultSet ; }
Fetches the result of select from database

@param Select $select
@param AbstractResultSet $resultSet
@return \Zend\Db\ResultSet\ResultSet|Paginator|HydratingResultSet
Fetches the result of select from database