Gets the preferences, as a tree structure

@return mixed
431571
public function getPreferences()
    {
        $url = $this->getApiEndpoint() . "/v2/preferences";

        $response = $this->setUrl($url)
            ->setVerb('GET')
            ->execute();

        if (isset($response->message)) {
            $this->helper->log('GET PREFERENCES: ' . $response->message);
        }

        return $response;
    }
566305
public function get_tree(){
		if(DEBUG_MODE){
			BLog::addToLog('[SoftModules]: get_tree()');
			}
		$brouter=BRouter::getInstance();
		$pages=$brouter->getsoftmodules();
		if(DEBUG_MODE){
			BLog::addToLog('[SoftModules]: Pages: '.var_export($pages,true));
			}
		$this->get_tree_node($pages);
		return $pages;
		}
408122
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('terrific_composer');

        $rootNode
            ->children()
                ->scalarNode('toolbar')->defaultFalse()->end()
                ->arrayNode('composition_bundles')
                    ->defaultValue(array('@TerrificComposition'))
                    ->beforeNormalization()
                        ->ifTrue(function($v){ return !is_array($v); })
                        ->then(function($v){ return array($v); })
                    ->end()
                    ->beforeNormalization()
                        ->always()
                        ->then(function($v) {
                            $bundles = array();

                            // trim and add @ if not existent
                            foreach ($v as $key => $bundle) {
                                $bundle = trim($bundle);

                                if(strpos($bundle, '@') === false) {
                                    $bundle = '@'.$bundle;
                                }
                                $bundles[$key] = $bundle;
                            }

                            return $bundles;
                        })
                    ->end()
                    ->prototype('scalar')->end()
                ->end()
                ->scalarNode('module_layout')
                    ->beforeNormalization()
                        ->always()
                        ->then(function($v) {
                            return str_replace('@', '', $v);
                        })
                    ->end()
                    ->defaultValue('TerrificComposition::base.html.twig')
                ->end()
                ->scalarNode('module_template')
                    ->beforeNormalization()
                        ->always()
                        ->then(function($v) {
                            return str_replace('@', '', $v);
                        })
                    ->end()
                    ->defaultValue(null)
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
417283
protected function addOptionsNode()
    {
        $builder = new TreeBuilder();
        $node    = $builder->root('options');

        $node
            ->prototype('variable')
            ->end();

        return $node;
    }
1256893
public function getOptions()
    {
        $options = [];
        foreach ($this->childNodes as $child) {
            if ($child instanceof Select\Option) {
                $options[] = $child;
            } else if ($child instanceof Select\Optgroup) {
                foreach ($child->getChildren() as $c) {
                    if ($c instanceof Select\Option) {
                        $options[] = $c;
                    }
                }
            }
        }
        return $options;
    }
52209
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();
        $rule    = $builder->root('rule');
        {
            $rule->children()->variableNode('pattern')->isRequired();
            $rule->children()->variableNode('roles')->isRequired()->beforeNormalization()->ifString()->then(
                function ($v) {
                    return [$v];
                }
            )->end();
            $rule->children()->enumNode('channel')->values([null, 'http', 'https'])->defaultValue(null);

        }

        return $builder;
    }
672667
public function properties() {
    $props = array();

    if ($this->itemScope()) {
      $toTraverse = array($this);

      foreach ($this->itemRef() as $itemref) {
        $children = $this->ownerDocument->xpath()->query('//*[@id="'.$itemref.'"]');
        foreach($children as $child) {
          $this->traverse($child, $toTraverse, $props, $this);
        }
      }
      while (count($toTraverse)) {
        $this->traverse($toTraverse[0], $toTraverse, $props, $this);
      }
    }

    return $props;
  }
702238
private function processPreferences($preferences, $processedPreferences)
    {
        foreach ($preferences as $preference) {
            $formattedPreference = [];
            $formattedPreference['isPreference'] = $preference->isPreference;
            if (! $preference->isPreference) {
                if (! isset($preference->preferences)) {
                    continue;
                }
                $formattedPreference['catLabel'] = $preference->publicName;
                $formattedCatPreferences = [];
                foreach ($preference->preferences as $catPreference) {
                    $formattedCatPreference = [];
                    $formattedCatPreference['label'] = $catPreference->publicName;
                    isset($catPreference->isOptedIn)? $formattedCatPreference['isOptedIn'] = $catPreference->isOptedIn :
                        $formattedCatPreference['isOptedIn'] = false;
                    $formattedCatPreferences[$catPreference->id] = $formattedCatPreference;
                }
                $formattedPreference['catPreferences'] = $formattedCatPreferences;
            } else {
                $formattedPreference['label'] = $preference->publicName;
                isset($catPreference->isOptedIn)? $formattedPreference['isOptedIn'] = $preference->isOptedIn :
                    $formattedPreference['isOptedIn'] = false;
            }
            $processedPreferences[$preference->id] = $formattedPreference;
        }
        return $processedPreferences;
    }
1098549
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('ezrichtext');

        $sections = $rootNode->children();
        $this
            ->addCustomTagsSection($sections);
        $this
            ->addCustomStylesSection($sections);
        $this
            ->addAlloyEditorSection($sections)
            ->end();

        return $treeBuilder;
    }
181579
public function getOptionTreeDefault()
    {
        return sprintf("['%s', '%s', '%s']",
            $this->getHub()->getName(),
            $this->getStartTime()->format('D j M'),
            $this->getStartTime()->format('H:i')
        );
    }
743593
public function get()
    {
        if (is_null($this->fromField)) {
            throw new \RuntimeException(
                'The HTTP field must be provided to the builder.'
            );
        }

        return new Preference(
            $this->variant,
            $this->getQualityFactor(),
            $this->getPrecedence()
        );
    }
403483
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();

        $root = $treeBuilder->root('form');
        $root
            ->children()
                ->arrayNode('themes')
                    ->fixXmlConfig('themes')
                    ->addDefaultChildrenIfNoneSet()
                    ->prototype('scalar')->defaultValue('default')->end()
                    ->validate()
                        ->ifTrue(function ($v) {
                            return !in_array('default', $v);
                        })
                        ->then(function ($v) {
                            return array_merge(['default'], $v);
                        })
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
767457
public function getConfigTreeBuilder()
    {
        $builder  = new TreeBuilder();
        $firewall = $builder->root('firewall');
        {
            $firewall->children()->variableNode('pattern')->isRequired();
            $firewall->children()->variableNode('policies')->isRequired();
            $firewall->children()->variableNode('users')->isRequired();
            $firewall->children()->booleanNode('stateless')->defaultValue('false');
            $firewall->children()->variableNode('misc')->defaultValue([]);
        }

        return $builder;
    }
1369448
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('framework');
        $rootNode
            ->children()
                ->arrayNode('language')
                    ->prototype('scalar')->end()
                ->end()
                ->booleanNode('prefer_cdn')
                    ->defaultFalse()
                ->end()
                ->scalarNode('project_name')
                    ->defaultValue('Demo')
                ->end()
                ->scalarNode('company_name')
                    ->defaultValue('Acme')
                ->end()
            ->end()
        ;
        $this->appendChordsNodes($rootNode);

        return $treeBuilder;
    }
311462
function get_prefs()
    {
        if (isset($this->prefs)) {
            return $this->prefs;
        }

        $this->prefs = array();

        if (!empty($this->language))
            $this->prefs['language'] = $this->language;

        if ($this->ID) {
            // Preferences from session (write-master is unavailable)
            if (!empty($_SESSION['preferences'])) {
                // Check last write attempt time, try to write again (every 5 minutes)
                if ($_SESSION['preferences_time'] < time() - 5 * 60) {
                    $saved_prefs = unserialize($_SESSION['preferences']);
                    $this->rc->session->remove('preferences');
                    $this->rc->session->remove('preferences_time');
                    $this->save_prefs($saved_prefs);
                }
                else {
                    $this->data['preferences'] = $_SESSION['preferences'];
                }
            }

            if ($this->data['preferences']) {
                $this->prefs += (array)unserialize($this->data['preferences']);
            }
        }

        return $this->prefs;
    }
1192057
public function getRelatedProperties()
    {
        //return $this->treeType->getCmsTreeTypeProperties();
        if (isset(self::$_treeTypes[$this->tree_type_id])) {
            $treeType = self::$_treeTypes[$this->tree_type_id];
        } else {
            self::$_treeTypes[$this->tree_type_id] = $this->treeType;
            $treeType = self::$_treeTypes[$this->tree_type_id];
        }
        if (!$treeType) {
            return CmsTreeTypeProperty::find()->where(['id' => null]);
        }
        //return $this->treeType->getCmsTreeTypeProperties();
        return $treeType->getCmsTreeTypeProperties();
    }
389537
public function getPreferencesPane()
    {
        parent::getPreferencesPane();
        $group = new XMLElement('fieldset');
        $group->setAttribute('class', 'settings condensed pickable');
        $group->setAttribute('id', 'sendmail');
        $group->appendChild(new XMLElement('legend', __('Email: Sendmail')));

        $div = new XMLElement('div');
        $div->setAttribute('class', 'two columns');

        $readonly = array('readonly' => 'readonly');

        $label = Widget::Label(__('From Name'));
        $label->setAttribute('class', 'column');
        $label->appendChild(Widget::Input('settings[email_sendmail][from_name]', General::sanitize($this->_sender_name), 'text', $readonly));
        $div->appendChild($label);

        $label = Widget::Label(__('From Email Address'));
        $label->setAttribute('class', 'column');
        $label->appendChild(Widget::Input('settings[email_sendmail][from_address]', General::sanitize($this->_sender_email_address), 'text', $readonly));
        $div->appendChild($label);

        $group->appendChild($div);

        return $group;
    }