original_string: public function getLimit($user_id)
      {
          if (is_numeric($user_id)) {
              $user = $this->user->get($user_id);
              if (isset($user['role_id'])) {
                  return $this->getLimitByRole($user['role_id']);
              }
          }
  
          return $this->getDefaultLimit();
      }
code: public function getLimit($user_id)
      {
          if (is_numeric($user_id)) {
              $user = $this->user->get($user_id);
              if (isset($user['role_id'])) {
                  return $this->getLimitByRole($user['role_id']);
              }
          }
  
          return $this->getDefaultLimit();
      }
code_tokens: public function getLimit ( $ user_id ) { if ( is_numeric ( $ user_id ) ) { $ user = $ this -> user -> get ( $ user_id ) ; if ( isset ( $ user [ 'role_id' ] ) ) { return $ this -> getLimitByRole ( $ user [ 'role_id' ] ) ; } } return $ this -> getDefaultLimit ( ) ; }
docstring: Returns a max number of items for the user
  @param integer|string $user_id
  @return integer
docstring_tokens: Returns a max number of items for the user