Skip to content

Instantly share code, notes, and snippets.

@jec006
Created July 11, 2012 18:21
Show Gist options
  • Save jec006/3092153 to your computer and use it in GitHub Desktop.
Save jec006/3092153 to your computer and use it in GitHub Desktop.
RootCondit
/**
* Helper method for getting and causing the root Condition
*
* The Root condition is the use as the basis for the constructing the preview form
* It can be expect that it will be much more complicated then the other conditions
*
* This method select the condition and its config using the config controller.
*
* @return \Drupal\sps\Plugins\ConditionInterface
* the current root condition object
*/
protected function getRootCondition() {
if(!isset($this->root_condition)) {
$settings = $this->config_controller->get(SPS_CONFIG_ROOT_CONDITION);
$root_condition_plugin = $settings['name'];
$this->root_condition = $this->getPlugin('condition', $root_condition_plugin);
//$this->root_condition->setConfig($settings['config']);
}
return $this->root_condition;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment