Fetch all options

@param null|string $group
@return mixed
331176
public function fetchAll(string $group = null)
    {
        if (static::$options === null) {
            static::$options = $this
                ->createModel()
                ->when($group, function ($query, $group) {
                    return $query->where('group', $group);
                })
                ->orderBy('group', 'asc')
                ->orderBy('key', 'asc')
                ->get();
        }

        return static::$options;
    }
414204
public static function pathsToPublish($group = null)
    {
        if (is_null($group)) {
            $paths = array();

            foreach (static::$publishes as $class => $publish) {
                $paths = array_merge($paths, $publish);
            }

            return array_unique($paths);
        } else if (array_key_exists($group, static::$publishes)) {
            return static::$publishes[$group];
        }

        return array();
    }
828254
public function getErrors($key = null, $group = null)
    {
        return $this->validator->getErrors($key, $group);
    }
349068
public function getGroup ($groupID)
    {
        $groups = $this->getAllGroups();
        
        foreach ($groups as $group) {
            if ($group->getID() == $groupID) {
                return $group;
            }
        }
        
        return null;
    }
1168198
public function getTabGroup(string $group): TabGroup
    {
        if (!isset($this->tabGroups[$group])) {
            throw new \InvalidArgumentException(sprintf('Requested group named "%s" is not found. Did you forget to tag the service?', $group));
        }

        return $this->tabGroups[$group];
    }
616431
public function getViews($fieldset = null, $group = null)
    {
        $views = [];

        foreach ($this->getFields($fieldset, $group) as $field) {
            $views[$field->getName(true)] = [
                'label' => $field->getLabel(),
                'value' => $field->renderView(),
            ];
        }

        return $views;
    }
1220778
protected function loadDataForGroup($group, $includeemptykeys = false) {
		// load strings to cache
		$file_path = $this->getGroupFile($group);
		
		if (!file_exists($file_path)) {	
			// translation file not found
			return null;
		}
		
		$lines = @file_get_contents($file_path);
		
		if ($lines == '') {
			return null;
		}
		
		$lines = preg_split('!\\r?\\n!', $lines);
		$lines = array_map('trim', $lines);
		
		$data = array();
		
		foreach($lines as $line) {
			if (strpos($line,'#') !== false) {
				// remove everything after #
				$line = substr($line,0,strpos($line,'#'));
			}
			list($k, $value) = explode('=', $line, 2);
			$k = trim($k);
			$value = trim($value);
			
			if (strpos($k,'#') === 0 || $k == '' || $value == '' && !$includeemptykeys) {
				// comment or empty line
				continue;
			}
			
			$data[$k] = $value;
		}
		
		return $data;
	}
408035
public function render($group = null)
    {
        $this->config('content.url', Router::url($this->config('content.url')));
        $content = $this->formatTemplate('content', $this->config('content'));

        if ($group) {
            $this->config(array_shift($this->_config['childConfig']));
            $menu = new MenuGroup([$this->config()], $this->_here);
            $content .= $menu->render($group);
            $this->_active = $this->_active || $menu->active();
        }

        return $content;
    }
1374377
public function get($key, $group = self::DEFAULT_GROUP, $default = null) {
        return isset($this->settings[$group][$key]) ? $this->settings[$group][$key] : $default;
    }
777107
public function getGroup($group)
    {
        $timeStamp = time();
        if ($group instanceof BundleEntity\MemberGroup) {
            return new ModelResponse($group, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
        }
        $result = null;
        switch ($group) {
            case is_numeric($group):
                $result = $this->em->getRepository($this->entity['mg']['name'])->findOneBy(array('id' => $group));
                break;
            case is_string($group):
                $result = $this->em->getRepository($this->entity['mg']['name'])->findOneBy(array('code' => $group));
                break;
        }
        if (is_null($result)) {
            return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
        }

        return new ModelResponse($result, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
    }
907110
public static function getIcons($group=null)
	{
		$key = $GLOBALS['BOOTSTRAP']['icons']['active'];

		// load icons if not done so far
		if(!isset($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons']))
		{
			if (TL_MODE == 'BE') {
				if (isset($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['stylesheet'])) {
					foreach ((array) $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['stylesheet'] as $stylesheet) {
						$GLOBALS['TL_CSS'][] = $stylesheet;
					}
				}
			}

			$GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'] =
				include TL_ROOT . '/' . $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['path'];
		}

		// get all icons
		if($group === null)
		{
			return $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'];
		}

		// get all icons as flat array
		elseif($group === true)
		{
			if(self::$flatIcons === null) {
				$icons = array();

				foreach ($GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'] as $groupIcons)
				{
					$icons = array_merge($icons, $groupIcons);
				}

				self::$flatIcons = $icons;
			}

			return self::$flatIcons;
		}

		return $GLOBALS['BOOTSTRAP']['icons']['sets'][$key]['icons'];
	}
946733
public function getAssets($group='head',$type=null) {
		$assets = array();
		if (!isset($this->assets[$group]))
			return $assets;
		$types = array_keys($this->assets[$group]);
		foreach($types as $asset_type) {
			if ($type && $type!=$asset_type)
				continue;
			krsort($this->assets[$group][$asset_type]);
			foreach($this->assets[$group][$asset_type] as $prio_set)
				foreach($prio_set as $asset) {
					if ($asset['origin']=='inline')
						$assets[$asset_type][$asset['data']] = $asset;
					else
						$assets[$asset_type][$asset['path']] = $asset;
				}
			$assets[$asset_type] = array_values($assets[$asset_type]);
		}
		return $assets;
	}
916099
protected function loadGroupConfig($group)
    {
        // data from files
        $res = $this->loader->load($group);

        // mark pool dirty
        if (count($res)) {
            $this->setPoolDirty();
        }

        $config = [];
        foreach($res as $grp => $grpData) {
            if (!isset($config[$grp])) {
                $config[$grp] = [];
            }
            foreach ($grpData as $data) {
                $config[$grp] = array_replace_recursive(
                    $config[$grp], $this->fixValue($data)
                );
            }
        }

        // set the whole pool
        if (null === $group) {
            $this->pool = $config;

        // set a group
        } else {
            $this->pool[$group] = $config[$group];
        }
    }
1310657
public function getCacheGroup($cacheGroup)
    {
        return !empty($this->cacheGroups[$cacheGroup]) ? $this->cacheGroups[$cacheGroup] : null;
    }
904
protected function getResponseCodeGroupRange($group) {
        switch ($group) {
            case 'informational':
                $min = 100;
                $max = 199;
                break;
            case 'success':
                $min = 200;
                $max = 299;
                break;
            case 'redirection':
                $min = 300;
                $max = 399;
                break;
            case 'client error':
                $min = 400;
                $max = 499;
                break;
            case 'server error':
                $min = 500;
                $max = 599;
                break;
            default:
                throw new InvalidArgumentException(sprintf('Invalid response code group: %s', $group));
        }

        return [
            'min' => $min,
            'max' => $max,
        ];
    }
901006
public function get($group, $default = null)
    {
        $this->autoFillIfNotDone();
        if (isset($this->buildConfigs[$group])) {
            return $this->buildConfigs[$group];
        }

        return $default;
    }
34149
public static function getUidListByGroup($group)
    {
        if (!static::isValidGroupId($group)) {
            return array();
        }

        $group = is_array($group) ? $group : array($group);
        $data = static::select(array('uid'), array('groups' => $group));
        $uid_map = array();
        foreach ($data as $local_ip => $buffer_array) {
            foreach ($buffer_array as $local_port => $items) {
                //$items = ['connection_id'=>['uid'=>x, 'group'=>[x,x..], 'session'=>[..]], 'client_id'=>[..], ..];
                foreach ($items as $connection_id => $info) {
                    if (!empty($info['uid'])) {
                        $uid_map[$info['uid']] = $info['uid'];
                    }
                }
            }
        }
        return $uid_map;
    }