You are here

public function TMGMTTranslator::getSetting in Translation Management Tool 7

Retrieves a setting value from the translator settings. Pulls the default values (if defined) from the plugin controller.

Parameters

$name: The name of the setting.

Return value

The setting value or $default if the setting value is not set. Returns NULL if the setting does not exist at all.

File

entity/tmgmt.entity.translator.inc, line 244

Class

TMGMTTranslator
Entity class for the tmgmt_translator entity.

Code

public function getSetting($name) {
  if (isset($this->settings[$name])) {
    return $this->settings[$name];
  }
  elseif ($controller = $this
    ->getController()) {
    $defaults = $controller
      ->defaultSettings();
    if (isset($defaults[$name])) {
      return $defaults[$name];
    }
  }
}