1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00
freshrss_ynh/sources/app/Models/Factory.php

33 lines
668 B
PHP
Raw Normal View History

2014-07-23 15:52:50 +02:00
<?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();
}
}
}