You are here

function mostpopular_service_load in Drupal Most Popular 7

Implements hook_load().

Loads a configured most popular service based on its ID.

Parameters

integer $sid : The ID of the configured service.

boolean $reset : True if the cache should be reset.

Return value

object A most popular service configuration from the database.

4 calls to mostpopular_service_load()
mostpopular_items_ajax in ./mostpopular.module
mostpopular_service_config_form in ./mostpopular.services.inc
mostpopular_service_delete_form in ./mostpopular.services.inc
mostpopular_service_title in ./mostpopular.module
Returns the name of a service, for the menu hooks.

File

./mostpopular.module, line 412
The main file for the Most Popular module.

Code

function mostpopular_service_load($sid, $reset = FALSE) {
  $services =& drupal_static(__FUNCTION__, array());
  if (!isset($services[$sid]) || $reset) {

    // Set variable so that it can be passed by reference
    $most = mostpopular_service_load_multiple(array(
      $sid,
    ));
    $services[$sid] = reset($most);
  }
  return $services[$sid];
}