original_string: public static function get_providers_preferences($providers, $userid) {
          $preferences = new \stdClass();
  
          // Get providers preferences.
          foreach ($providers as $provider) {
              foreach (array('loggedin', 'loggedoff') as $state) {
                  $linepref = get_user_preferences('message_provider_' . $provider->component . '_' . $provider->name
                      . '_' . $state, '', $userid);
                  if ($linepref == '') {
                      continue;
                  }
                  $lineprefarray = explode(',', $linepref);
                  $preferences->{$provider->component.'_'.$provider->name.'_'.$state} = array();
                  foreach ($lineprefarray as $pref) {
                      $preferences->{$provider->component.'_'.$provider->name.'_'.$state}[$pref] = 1;
                  }
              }
          }
  
          return $preferences;
      }
code: public static function get_providers_preferences($providers, $userid) {
          $preferences = new \stdClass();
  
          // Get providers preferences.
          foreach ($providers as $provider) {
              foreach (array('loggedin', 'loggedoff') as $state) {
                  $linepref = get_user_preferences('message_provider_' . $provider->component . '_' . $provider->name
                      . '_' . $state, '', $userid);
                  if ($linepref == '') {
                      continue;
                  }
                  $lineprefarray = explode(',', $linepref);
                  $preferences->{$provider->component.'_'.$provider->name.'_'.$state} = array();
                  foreach ($lineprefarray as $pref) {
                      $preferences->{$provider->component.'_'.$provider->name.'_'.$state}[$pref] = 1;
                  }
              }
          }
  
          return $preferences;
      }
code_tokens: public static function get_providers_preferences ( $ providers , $ userid ) { $ preferences = new \ stdClass ( ) ; // Get providers preferences. foreach ( $ providers as $ provider ) { foreach ( array ( 'loggedin' , 'loggedoff' ) as $ state ) { $ linepref = get_user_preferences ( 'message_provider_' . $ provider -> component . '_' . $ provider -> name . '_' . $ state , '' , $ userid ) ; if ( $ linepref == '' ) { continue ; } $ lineprefarray = explode ( ',' , $ linepref ) ; $ preferences -> { $ provider -> component . '_' . $ provider -> name . '_' . $ state } = array ( ) ; foreach ( $ lineprefarray as $ pref ) { $ preferences -> { $ provider -> component . '_' . $ provider -> name . '_' . $ state } [ $ pref ] = 1 ; } } } return $ preferences ; }
docstring: Get providers preferences.
  
  @param array $providers
  @param int $userid
  @return \stdClass
docstring_tokens: Get providers preferences .