diff options
| author | 2014-07-21 18:00:32 +0200 | |
|---|---|---|
| committer | 2014-07-21 18:00:32 +0200 | |
| commit | 8d7ac978f9af4819fc788e7e0a514dc7ca9886d9 (patch) | |
| tree | fcc7e399a5f628a904518b7b522b17cef67a76e1 /app/Models/Factory.php | |
| parent | a4dac0f791ae6d34b64cee5a3fae1815f6f70a2b (diff) | |
| parent | 73bbdaa015ec8596603fa88bd2cb03f85548e05e (diff) | |
Merge branch 'dev' into beta
Diffstat (limited to 'app/Models/Factory.php')
| -rw-r--r-- | app/Models/Factory.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/Models/Factory.php b/app/Models/Factory.php new file mode 100644 index 000000000..08569b2e2 --- /dev/null +++ b/app/Models/Factory.php @@ -0,0 +1,32 @@ +<?php + +class FreshRSS_Factory { + + public static function createFeedDao() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_FeedDAOSQLite(); + } else { + return new FreshRSS_FeedDAO(); + } + } + + public static function createEntryDao() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_EntryDAOSQLite(); + } else { + return new FreshRSS_EntryDAO(); + } + } + + public static function createStatsDAO() { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_StatsDAOSQLite(); + } else { + return new FreshRSS_StatsDAO(); + } + } + +} |
