You are here

function variable_realm_weight in Variable 7.2

Same name and namespace in other branches
  1. 7 variable_realm/variable_realm.module \variable_realm_weight()

Get / set realm weights.

The default realm will have a weight of 0. Realms with higher weights will override global variables.

Parameters

$realm: Realm name

$weight: Optional numeric value for realm weight.

Return value

integer Current realm weight

1 call to variable_realm_weight()
variable_realm_add in variable_realm/variable_realm.module
Set values for variable realm

File

variable_realm/variable_realm.module, line 409
Variable API module - Realms

Code

function variable_realm_weight($realm, $weight = NULL) {
  if ($realm_controller = variable_realm_controller($realm)) {
    if (isset($weight)) {
      $realm_controller
        ->setWeight($weight);
    }
    return $realm_controller
      ->getWeight();
  }
}