protected function _getCachedStatement( MW_DB_Connection_Interface $conn, $key, $sql = null )
	{
		if( !isset( $this->_stmts['stmt'][$key] ) || !isset( $this->_stmts['conn'][$key] ) || $conn !== $this->_stmts['conn'][$key] )
		{
			if( $sql === null ) {
				$sql = $this->_context->getConfig()->get( $key, $key );
			}

			$this->_stmts['stmt'][$key] = $conn->create( $sql );
			$this->_stmts['conn'][$key] = $conn;
		}

		return $this->_stmts['stmt'][$key];
	}
protected function _getCachedStatement( MW_DB_Connection_Interface $conn, $key, $sql = null )
	{
		if( !isset( $this->_stmts['stmt'][$key] ) || !isset( $this->_stmts['conn'][$key] ) || $conn !== $this->_stmts['conn'][$key] )
		{
			if( $sql === null ) {
				$sql = $this->_context->getConfig()->get( $key, $key );
			}

			$this->_stmts['stmt'][$key] = $conn->create( $sql );
			$this->_stmts['conn'][$key] = $conn;
		}

		return $this->_stmts['stmt'][$key];
	}
protected function _getCachedStatement ( MW_DB_Connection_Interface $ conn , $ key , $ sql = null ) { if ( ! isset ( $ this -> _stmts [ 'stmt' ] [ $ key ] ) || ! isset ( $ this -> _stmts [ 'conn' ] [ $ key ] ) || $ conn !== $ this -> _stmts [ 'conn' ] [ $ key ] ) { if ( $ sql === null ) { $ sql = $ this -> _context -> getConfig ( ) -> get ( $ key , $ key ) ; } $ this -> _stmts [ 'stmt' ] [ $ key ] = $ conn -> create ( $ sql ) ; $ this -> _stmts [ 'conn' ] [ $ key ] = $ conn ; } return $ this -> _stmts [ 'stmt' ] [ $ key ] ; }
Returns the cached statement for the given key or creates a new prepared statement.
If no SQL string is given, the key is used to retrieve the SQL string from the configuration.

@param MW_DB_Connection_Interface $conn Database connection
@param string $key Unique key for the SQL
@param string|null $sql SQL string if it shouldn't be retrieved from the configuration
Returns the cached statement for the given key or creates a new prepared statement . If no SQL string is given the key is used to retrieve the SQL string from the configuration .