You are here

public function TMGMTJob::getSetting in Translation Management Tool 7

Retrieves a setting value from the job 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.job.inc, line 347

Class

TMGMTJob
Entity class for the tmgmt_job entity.

Code

public function getSetting($name) {
  if (isset($this->settings[$name])) {
    return $this->settings[$name];
  }

  // The translator might provide default settings.
  if ($translator = $this
    ->getTranslator()) {
    if (($setting = $translator
      ->getSetting($name)) !== NULL) {
      return $setting;
    }
  }
  if ($controller = $this
    ->getTranslatorController()) {
    $defaults = $controller
      ->defaultSettings();
    if (isset($defaults[$name])) {
      return $defaults[$name];
    }
  }
}