public function fetch($type = null) {

		if(null !== $type && false === is_string($type)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
		}

		$results = new ResultSet([], $type);

		//Returns a copy of a value
		$copy 	= function($a) { return $a; };
		$amount = count($this -> stmt);

		foreach($this -> stmt as $stmt) {

			//Execute statement and store results
			$stmt 	= $this -> executeStatement($stmt);
			$result = [];

			if(false !== $stmt && 0 !== $stmt -> field_count && 0 === $stmt -> errno) {
				
				$vars = $this -> bind($stmt);

				while($stmt -> fetch()) {

					if($amount === 1) {
				    	$results -> append(array_map($copy, $vars));
				    }
				    else {
				    	$result[] = array_map($copy, $vars);
				    }
				}
			}
			
			if($amount > 1) {
				$results -> append($result);
			}
		}

		$this -> shadow = $this -> stmt;
		$this -> reset();

		return $results;
	}
public function fetch($type = null) {

		if(null !== $type && false === is_string($type)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
		}

		$results = new ResultSet([], $type);

		//Returns a copy of a value
		$copy 	= function($a) { return $a; };
		$amount = count($this -> stmt);

		foreach($this -> stmt as $stmt) {

			//Execute statement and store results
			$stmt 	= $this -> executeStatement($stmt);
			$result = [];

			if(false !== $stmt && 0 !== $stmt -> field_count && 0 === $stmt -> errno) {
				
				$vars = $this -> bind($stmt);

				while($stmt -> fetch()) {

					if($amount === 1) {
				    	$results -> append(array_map($copy, $vars));
				    }
				    else {
				    	$result[] = array_map($copy, $vars);
				    }
				}
			}
			
			if($amount > 1) {
				$results -> append($result);
			}
		}

		$this -> shadow = $this -> stmt;
		$this -> reset();

		return $results;
	}
public function fetch ( $ type = null ) { if ( null !== $ type && false === is_string ( $ type ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ query ) ) , E_USER_ERROR ) ; } $ results = new ResultSet ( [ ] , $ type ) ; //Returns a copy of a value
 $ copy = function ( $ a ) { return $ a ; } ; $ amount = count ( $ this -> stmt ) ; foreach ( $ this -> stmt as $ stmt ) { //Execute statement and store results
 $ stmt = $ this -> executeStatement ( $ stmt ) ; $ result = [ ] ; if ( false !== $ stmt && 0 !== $ stmt -> field_count && 0 === $ stmt -> errno ) { $ vars = $ this -> bind ( $ stmt ) ; while ( $ stmt -> fetch ( ) ) { if ( $ amount === 1 ) { $ results -> append ( array_map ( $ copy , $ vars ) ) ; } else { $ result [ ] = array_map ( $ copy , $ vars ) ; } } } if ( $ amount > 1 ) { $ results -> append ( $ result ) ; } } $ this -> shadow = $ this -> stmt ; $ this -> reset ( ) ; return $ results ; }
Returns results from statement as an result set
@param string $type
@return sFire\Adapter\ResultSet
Returns results from statement as an result set