You are here

function _modules_weight_module_get_weight in Modules weight 7

Gets the weight of a particular module.

Parameters

string $module: The name of the module (without the .module extension).

Return value

int An integer representing the weight of the module.

1 call to _modules_weight_module_get_weight()
drush_modules_weight_mw_reorder in ./modules_weight.drush.inc
Callback for the mw-reorder command.

File

./modules_weight.helpers.inc, line 99
Helper functions.

Code

function _modules_weight_module_get_weight($module) {

  // The query.
  $query = "SELECT weight\n            FROM {system}\n            WHERE type = 'module'\n              AND name = :name";

  // Executing the query and getting the module weight.
  $weight = db_query($query, array(
    ':name' => $module,
  ))
    ->fetchObject()->weight;
  return $weight;
}