diff options
| author | 2014-10-31 17:21:20 +0100 | |
|---|---|---|
| committer | 2014-10-31 17:21:20 +0100 | |
| commit | 105729639bd06c27536bbdd2968873046278d59f (patch) | |
| tree | 30dcf7e3ae471b30810fb22ed701e0bb7d034fc8 /app/Models/Factory.php | |
| parent | caf98a6468dcea5ae8c38062e4eb527cb3667db9 (diff) | |
| parent | ee50df518310d3aee5efb5a0c15548b457d10e7e (diff) | |
Merge branch 'beta' into hotfixes
Diffstat (limited to 'app/Models/Factory.php')
| -rw-r--r-- | app/Models/Factory.php | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/app/Models/Factory.php b/app/Models/Factory.php index 08569b2e2..91cb84998 100644 --- a/app/Models/Factory.php +++ b/app/Models/Factory.php @@ -2,30 +2,39 @@ class FreshRSS_Factory { - public static function createFeedDao() { + public static function createFeedDao($username = null) { $db = Minz_Configuration::dataBase(); if ($db['type'] === 'sqlite') { - return new FreshRSS_FeedDAOSQLite(); + return new FreshRSS_FeedDAOSQLite($username); } else { - return new FreshRSS_FeedDAO(); + return new FreshRSS_FeedDAO($username); } } - public static function createEntryDao() { + public static function createEntryDao($username = null) { $db = Minz_Configuration::dataBase(); if ($db['type'] === 'sqlite') { - return new FreshRSS_EntryDAOSQLite(); + return new FreshRSS_EntryDAOSQLite($username); } else { - return new FreshRSS_EntryDAO(); + return new FreshRSS_EntryDAO($username); } } - public static function createStatsDAO() { + public static function createStatsDAO($username = null) { $db = Minz_Configuration::dataBase(); if ($db['type'] === 'sqlite') { - return new FreshRSS_StatsDAOSQLite(); + return new FreshRSS_StatsDAOSQLite($username); } else { - return new FreshRSS_StatsDAO(); + return new FreshRSS_StatsDAO($username); + } + } + + public static function createDatabaseDAO($username = null) { + $db = Minz_Configuration::dataBase(); + if ($db['type'] === 'sqlite') { + return new FreshRSS_DatabaseDAOSQLite($username); + } else { + return new FreshRSS_DatabaseDAO($username); } } |
