protected function getFiltered(array $all_settings = array(), $groups = null, $flag = null)
    {
        $settings = array();

        foreach ($all_settings as $setting) {
            if ($setting->matchesGroup($groups) && $setting->matchesFlag($flag)) {
                $settings[] = $setting;
            }
        }

        return $settings;
    }