code: function(resolution) {
        
          if (this.resolutions != null) {
              return OpenLayers.Layer.prototype.getZoomForResolution.apply(this, arguments);
          } else {
              var extent = OpenLayers.Layer.prototype.getExtent.apply(this, []);
              return this.getZoomForExtent(extent);
          }
      }
docs: Method: getZoomForResolution
  Get the zoom level for a given resolution
  
  Parameters:
  resolution - {Float}
  
  Returns:
  {Integer} A suitable zoom level for the specified resolution.
  If no baselayer is set, returns null.