public function permissionGetCategoryById($permid)
  {
    if(!is_numeric($permid))
    {
      $permid = $this->permissionGetIdByName($permid);
    }

    if($permid < 0x1000)
    {
      if($this->permissionEnds === null)
      {
        $this->fetchPermissionList();
      }

      if($this->permissionCats === null)
      {
        $this->fetchPermissionCats();
      }

      $catids = array_values($this->permissionCats());

      foreach($this->permissionEnds as $key => $val)
      {
        if($val >= $permid && isset($catids[$key]))
        {
          return $catids[$key];
        }
      }

      return 0;
    }
    else
    {
      return (int) $permid >> 8;
    }
  }
public function permissionGetCategoryById($permid)
  {
    if(!is_numeric($permid))
    {
      $permid = $this->permissionGetIdByName($permid);
    }

    if($permid < 0x1000)
    {
      if($this->permissionEnds === null)
      {
        $this->fetchPermissionList();
      }

      if($this->permissionCats === null)
      {
        $this->fetchPermissionCats();
      }

      $catids = array_values($this->permissionCats());

      foreach($this->permissionEnds as $key => $val)
      {
        if($val >= $permid && isset($catids[$key]))
        {
          return $catids[$key];
        }
      }

      return 0;
    }
    else
    {
      return (int) $permid >> 8;
    }
  }
public function permissionGetCategoryById ( $ permid ) { if ( ! is_numeric ( $ permid ) ) { $ permid = $ this -> permissionGetIdByName ( $ permid ) ; } if ( $ permid < 0x1000 ) { if ( $ this -> permissionEnds === null ) { $ this -> fetchPermissionList ( ) ; } if ( $ this -> permissionCats === null ) { $ this -> fetchPermissionCats ( ) ; } $ catids = array_values ( $ this -> permissionCats ( ) ) ; foreach ( $ this -> permissionEnds as $ key => $ val ) { if ( $ val >= $ permid && isset ( $ catids [ $ key ] ) ) { return $ catids [ $ key ] ; } } return 0 ; } else { return ( int ) $ permid >> 8 ; } }
Returns the internal category of the permission matching the given ID.

All pre-3.0.7 permission IDs are are 2 bytes wide. The first byte identifies the category while
the second byte is the permission count within that group.

@param  integer $permid
@return integer
Returns the internal category of the permission matching the given ID .