aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Factory.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-09 15:53:10 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-09 15:53:10 +0200
commitf97d4b3b6cca4a55636bbd50158f3c57666b0f08 (patch)
tree3ca9dd42155228292f0842d65b9b6d90e9140639 /app/Models/Factory.php
parente51ceb6812e3736aa9b9ce1f2d5181f5b4b6aaa3 (diff)
parent444b1552364b39761c3278c7da5152fd3998f216 (diff)
Merge branch 'master' into hotfixes
Diffstat (limited to 'app/Models/Factory.php')
-rw-r--r--app/Models/Factory.php32
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();
+ }
+ }
+
+}