From 8e9cf4fd2e23691a9b4fbae5b3c96d19da7d2ec3 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 15 Jul 2015 23:16:57 +0200 Subject: [PATCH] Move settings repositories to own namespace Also add a third method to the contract. This will help with building a caching decorator. --- src/Core/{ => Settings}/DatabaseSettingsRepository.php | 9 +++++++-- .../SettingsRepository.php} | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) rename src/Core/{ => Settings}/DatabaseSettingsRepository.php (73%) rename src/Core/{SettingsRepositoryInterface.php => Settings/SettingsRepository.php} (52%) diff --git a/src/Core/DatabaseSettingsRepository.php b/src/Core/Settings/DatabaseSettingsRepository.php similarity index 73% rename from src/Core/DatabaseSettingsRepository.php rename to src/Core/Settings/DatabaseSettingsRepository.php index c7d86d5c2..ec726eefe 100644 --- a/src/Core/DatabaseSettingsRepository.php +++ b/src/Core/Settings/DatabaseSettingsRepository.php @@ -1,10 +1,10 @@ database = $connection; } + public function all() + { + return $this->database->table('config')->lists('value', 'key'); + } + public function get($key, $default = null) { if (is_null($value = $this->database->table('config')->where('key', $key)->pluck('value'))) { diff --git a/src/Core/SettingsRepositoryInterface.php b/src/Core/Settings/SettingsRepository.php similarity index 52% rename from src/Core/SettingsRepositoryInterface.php rename to src/Core/Settings/SettingsRepository.php index 5007e0f06..1b226236e 100644 --- a/src/Core/SettingsRepositoryInterface.php +++ b/src/Core/Settings/SettingsRepository.php @@ -1,9 +1,11 @@