code: protected function getName($name)
      {
          preg_match("/off([0-9]+)/", $name, $nameMatch);
          if (isset($nameMatch[1])) {
              $name = (int) $nameMatch[1];
          }
          return $name;
      }
docs: Find the name/offset of a resource.
  If trying access resource "off0" this should grab the first
  resource stored. Which means removing the "off" part and making
  the name of the resource sought simply the number 0.
  
  @param $name The designed resource. A name or offset.
  @return Mixed